PIL font encoding

L

Laszlo Nagy

def getfnt(size):
return ImageFont.truetype("cartoon.ttf",size,encoding='unic')

Using the above function, I cannot draw special german characters. E.g.

u'L\xfctgendorf'


It will print "Lutgendorf" instead of "Lütgendorf". Much more
interesting is that I can also do this:

def getfnt(size):
return
ImageFont.truetype("cartoon.ttf",size,encoding='put_somethin_here_it_has_no_effect
WHAT?????? ')

Same results. Shouldn't the truetype constructor raise an exception if
the encoding is invalid and/or not available with the selected font?

BTW my "cartoon.ttf" font is able to print "Lütgendorf". I have tested
it from GIMP. So I'm 100% sure that the problem is with PIL.

Thank you,

Laszlo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top