[Image-SIG] font rendering problem

Ron Cybulskie revenge at gmail.com
Thu Feb 10 18:07:34 CET 2005

I am having problems rendering centain fonts using PIL 1.1.4 (and 1.1.5).
One font that is causing problems is Marlett - a standard windows font.

the following code:

import Image, ImageFont, ImageDraw

image = Image.new("RGB",(800,600))
fontpath = "C:\\WINDOWS\\Fonts\\Marlett.ttf"

font = ImageFont.truetype(fontpath,18)
draw = ImageDraw.Draw(image)
draw.text((10, 10), "abcdefghijklmnopqrstuvwxyzASDFGH1234567",
font=font, fill="#ffffff")

wont bomb out - the GIF saves out - but the glyphs are not rendering. 
I'm getting square boxes for each of the glyphs.   Since I'm fairly
unfamiliar with the TrueType format I'm not sure how the font actually
differs from other baked-in windows fonts like Times or Arial.
any help is appreciated.

Ron Cybulskie
revenge at gmail.com

More information about the Image-SIG mailing list