[reportlab-users] (no subject)

Ian Sparks reportlab-users@reportlab.com
Tue, 10 Feb 2004 09:07:11 -0500


>>
Yes.  That's the bottom line: you need a font with the characters,
<<

Well, I can paste my Polish characters into Word using the Windows Arial =
TT Font and they display fine. So clearly the Windows Arial TT font has =
support for these characters.

So if I embed the Windows Arial TT Font and use that it should display =
them correctly. But no. Instead, the display is "downgraded" to standard =
Latin-1 characters.

>>
and you need to encode your text string the same way as the font
is encoded.
<<

To show these characters using a TTFont ReportLab is going to require =
they are utf-8 but they definately pass through an iso-8859-2 encoding =
step on the way :

x =3D "Oddzia=B3 Dzieci=EAcy Chor=F3b W=B9troby"

x =3D  unicode(x, "iso-8859-2").encode("utf-8")

from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
file =3D 'C:/WINNT/FONTS/ARIAL.TTF'
pdfmetrics.registerFont(TTFont('ARIAL2',file))

from reportlab.pdfgen import canvas
c =3D canvas.Canvas("test.pdf")
c.setFont('ARIAL2',12)
c.drawString(40,700,x)
c.showPage()
c.save()


>>
we had some input
from Eastern European users a few months back which included
references to fonts...
<<

Thanks, I tracked back through the Czech discussions which helped a bit. =
I'm trying to take the "embed a TT font with support and encode using =
utf-8" approach which was posited during that thread but as you can see, =
its not working out.

I'm missing something....

Thanks!

-----Original Message-----
From: Andy Robinson [mailto:andy@reportlab.com]
Sent: Tuesday, February 10, 2004 6:55 AM
To: reportlab-users@reportlab.com
Subject: RE: [reportlab-users] (no subject)


> c.setFont('Courier',12)
> #Am I going to need a "Polish character aware" font? Any resources for
this?

Yes.  That's the bottom line: you need a font with the characters,
and you need to encode your text string the same way as the font
is encoded.  I'm just off into a meeting but we had some input
from Eastern European users a few months back which included
references to fonts...

Thanks,

Andy Robinson

_______________________________________________
reportlab-users mailing list
reportlab-users@reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users