I'm trying to generate a pdf in flutter using the package PDF ,, here is my code :
final doc = pw.Document();
var data = await rootBundle.load("assets/fonts/arial.ttf");
var myFont = Font.ttf(data);
String test = 'الشكرمون طاخ فى الترارولى';
var data2 = utf8.encode(test);
doc.addPage(
pw.Page(
build: (pw.Context context) => pw.Center(
child: pw.Text(test, style: pw.TextStyle(fontSize: 80,font: myFont)),
),
),
);
and here is how it is being generated :
while the actual result expected should be not chars separated, here is an example of what I should see :

