sel*_*cia 3 reportlab linux-mint python-2.7
我想用reportlab写一些土耳其语字符到pdf.我用fallowing代码来做这件事.
c = Canvas("test.pdf")
data="?ç?ö?ü"
p = Paragraph(data.decode('utf-8'), style=styNormal)
Run Code Online (Sandbox Code Playgroud)
但它没有以PDF格式显示我的数据.
输出:■ç■ö■ü
正如在类似问题的答案中所解释的,您需要使用支持您的角色的字体.
简而言之,试试这个:
pdfmetrics.registerFont(TTFont('Verdana', 'Verdana.ttf'))
c.setFont("Verdana", 8)
Run Code Online (Sandbox Code Playgroud)