dart_pdf
dart_pdf copied to clipboard
Bangla text Rendering issue.
getting this bangla text.
want this bangla text.
when i am copying from the generated pdf, and pasting some where else the text gets right.
code : final pdf = pw.Document(); var logger = Logger();
final banglaFont =
await rootBundle.load("assets/fonts/AnekBangla/kalpurush.ttf");
final banglaFontTtf = pw.Font.ttf(banglaFont);
pw.Table( border: pw.TableBorder.all(), children: [ pw.TableRow( pw.Text("${innerLoop.groupid} - ${innerLoop.grpnam}", style: pw.TextStyle( font: banglaFontTtf, fontSize: 6, ), textAlign: pw.TextAlign.center, maxLines: 1), ) ]
)
Kemon acho vai ,it seems same to me :D I don't know the solution i just wanted to say hi !
Oh you should look at this. I guess for Bangla ,help needed. #219
solved it. using unicode to bijoy. suppose this is the text : innerLoop.grpnam.toString() in this code :
pw.Text( "${innerLoop.groupid} - ${CodeUtil.unicodeToBijoyText(innerLoop.grpnam.toString())}", style: pw.TextStyle( font: banglaFontTtf, fontSize: 6, )
static String unicodeToBijoyText(String text) {
return unicodeToBijoy(utf8.decode(utf8.encode(text)));
}
i found that solution by on the day when i found it. but posting it hope it helps.
unicodeToBijoy
How to use this? Any example will be helpful.
I already showed my approach to solve it. You can check above.
I already showed my approach to solve it. You can check above.
I already fixed it another way. Thanks for your quick response.