[reportlab-users] Unicode use with reportlab

Andy Robinson andy at reportlab.com
Mon Jan 24 10:03:44 EST 2005


> Hi Andy.
> 
> Thank you for your quick answer. Now two others:
> 
> What are the TrueType fonts available on ReportLab on Linux to use? 

I have no idea, I don't use Linux.  I do know that .ttf 
files copied from Windows machines seem to work fine
on a variety of Unix servers.  We ship a rina.ttf which should
already be on the font search path for testing...

> And how can I select them from reportlab?

See section 3.6 of our user guide, but here's the summary:

from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
pdfmetrics.registerFont(TTFont('Rina', 'rina.ttf'))
canvas.setFont(Rina, 32)
canvas.drawString(10, 150, "Some text encoded in UTF-8")
canvas.drawString(10, 100, "In the Rina TT Font!")

Hope this helps,

Andy


More information about the reportlab-users mailing list