[Image-SIG] Python MemoryError on a ttf font

Donn donn.ingle at gmail.com
Tue Dec 25 18:36:32 CET 2007


Hi again,
 I thought I'd let you know about another font that's causing an error. The 
font is attached. Here's the code that I used:

paf = "/home/donn/06.FontStore/TTFS/O/Onsoku Seinen Plane.ttf"  
text = "Test Text"
font = ImageFont.truetype( paf, 64, index=0, encoding="unicode" )
pilheight = int( font.getsize( text )[1] )
pilimage = Image.new("RGB", (500,pilheight), (255,255,255)) 
drawnFont = ImageDraw.Draw( pilimage )
# This line causes a MemoryError:
drawnFont.text((0,0) , text, font=font, fill=0 )

Is there any way to tell ahead of time (i.e. without having to render it 
with.text) that it's a candidate for error?

Regards,
Donn.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Onsoku Seinen Plane.ttf
Type: application/x-font-ttf
Size: 67244 bytes
Desc: not available
Url : http://mail.python.org/pipermail/image-sig/attachments/20071225/055c7253/attachment-0001.bin 


More information about the Image-SIG mailing list