issue with arabic letters

Hello,

i have issue when i try generate 'Pdf' with arabic fonts , some letters don't display , i tried with different fonts but i get same issue


my code :


Future<List<int>> _readFontData() async {
final ByteData bytes = await rootBundle.load('assets/LamaSans.ttf');
return bytes.buffer.asUint8List(bytes.offsetInBytes, bytes.lengthInBytes);
}



PdfFont font = PdfTrueTypeFont(await _readFontData(), 62);


page.graphics.drawString(
'نور السماء',
font,
brush: PdfBrushes.black,
bounds: Rect.fromLTWH(page.size.width - 1500, 777, 1100, 130),
format: PdfStringFormat(
textDirection: PdfTextDirection.rightToLeft,
alignment: PdfTextAlignment.center,
lineAlignment: PdfVerticalAlignment.middle
),
);

output :

نو لسما

2 Replies 1 reply marked as answer

IJ Irfana Jaffer Sadhik Syncfusion Team May 15, 2023 06:05 AM UTC

On analysis, we found that the LamaSans font is not supported Arabic characters.

Ensured the supported languages in the font using, https://fontdrop.info/

image

 

We have attached a working sample to preserve Arabic language characters for your reference,

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/fluttersample819238272

Output: https://www.syncfusion.com/downloads/support/directtrac/general/pd/pdf_output1563267797



Marked as answer

MA Mohammedl Aqee May 16, 2023 01:00 PM UTC

Hi  Irfana Jaffer Sadhik ,

thanks for help , its work like magic :)



Loader.
Up arrow icon