Bangla words are broken while writing in a PDF file

Question:

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!

Asked By: asif abdullah

||

Answers:

You can use images instead of text.

Answered By: user17976254
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.