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

In FPDF Kannada fonts are not displaying correctly. #202

Open
gksathyarao opened this issue Jul 21, 2022 · 1 comment
Open

In FPDF Kannada fonts are not displaying correctly. #202

gksathyarao opened this issue Jul 21, 2022 · 1 comment

Comments

@gksathyarao
Copy link

In Python and FPDF , Kannada fonts are not displaying properly. Tried different Kannada /Uni code fonts but having same issue.
characters jumbled and does not show it properly .
Code : example
from fpdf import FPDF

pdf = FPDF()
pdf.add_page()
pdf.add_font('kan','','/Users/sathyarao/Library/Fonts/AnekKannada-VariableFont_wdth,wght.ttf')
pdf.set_font("kan",size=30)
ktext='ಕನ್ನಡ ರಾಜ್ಯ ಹೇಮ್ಮೇಯ ನಾಡು'
pdf.cell(150, 30, txt = ktext , align='c')
pdf.ln(30)
pdf.output('font.pdf')
print(ktext)

Correct way to display kannada is 'ಕನ್ನಡ ರಾಜ್ಯ ಹೇಮ್ಮೇಯ ನಾಡು' but in FPDF we see it as

image

print(ktext) - shows it correctly only issue with fpdf

ಕನ್ನಡ ರಾಜ್ಯ ಹೇಮ್ಮೇಯ ನಾಡು

Please help us to display Kannada words properly. Looks like this is issue will Indian languages.

@gksathyarao gksathyarao changed the title In FPDF Kannda fonts are not displaying correctly. In FPDF Kannada fonts are not displaying correctly. Jul 21, 2022
@Lucas-C
Copy link

Lucas-C commented Aug 15, 2022

pyfpdf is not maintained anymore, have you tried using fpdf2?
https://pyfpdf.github.io/fpdf2/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants