Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bangla text Rendering issue. #1639

Open
helper-bud opened this issue Mar 30, 2024 · 4 comments
Open

Bangla text Rendering issue. #1639

helper-bud opened this issue Mar 30, 2024 · 4 comments
Labels
bug Something isn't working needs triage

Comments

@helper-bud
Copy link

helper-bud commented Mar 30, 2024

getting this bangla text.
Screenshot 2024-03-30 112609
want this bangla text.
Screenshot 2024-03-30 144903

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),
)
]

)

@helper-bud helper-bud added bug Something isn't working needs triage labels Mar 30, 2024
@bksbora
Copy link

bksbora commented May 21, 2024

Kemon acho vai ,it seems same to me :D I don't know the solution i just wanted to say hi !

@bksbora
Copy link

bksbora commented May 21, 2024

Oh you should look at this. I guess for Bangla ,help needed. #219

@Tarikul-Islam-Shykat
Copy link

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)));

}

@Tarikul-Islam-Shykat
Copy link

i found that solution by on the day when i found it.
but posting it hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

3 participants