Bangla words are broken while writing in a PDF file

427 Views Asked by At

I am generating a PDF file from CSV file. While I tried to write BANGLA language it just broke the words. Here is my code:

from fpdf import FPDF

pdf = FPDF(orientation='L', unit='mm', format='A5')
pdf.add_page()


pdf.add_font('kalpurush','','fileLocation/kalpurush.ttf', uni=True)
pdf.set_font('kalpurush','',18)
pdf.set_xy(10,10)
pdf.set_text_color(0, 0, 0)
pdf.cell(w = 0,h=0.0, align='L', txt=u"শিরোনাম", border=0)
pdf.output("test.pdf")

The output file for the text (শিরোনাম) showing like this:

enter image description here

I have tried different .ttf file also. But didn't find any solution!

1

There are 1 best solutions below

1
On BEST ANSWER

You can use images instead of text.