[Image-SIG] draw.text problem

Andre Kuehne andre.kuehne at gmx.net
Thu Oct 7 14:30:00 CEST 2004


Hello.

My problem is that draw.text() seems to cut the lowest row of
a font. You can see that with the chars "gjQ{}[]" for example.
I tried several TrueType fonts with the same result.

There is a small test script attached, which shows the problem.
You can look at its output here:
http://hcoop.net/~aku/pil/text.png

And here is an image which shows how "gjQ{}[]" should look like:
http://hcoop.net/~aku/pil/text_ref.png

I made this also with pil a while ago. But i don't know what changed
since then. Do you get the same output with the script? Thanks in
advance for any help.

Regards

-- 
     _   _
_/\_| |_( )_
Andre Kuehne
-------------- next part --------------
#!/usr/bin/python

import Image, ImageDraw, ImageFont

fontPath = "/usr/X11R6/lib/X11/fonts/truetype/verdanab.ttf"
fontSize = 15
text = "efghijkOPQR{}[]!_()"

fnt=ImageFont.truetype(fontPath, fontSize)
image = Image.new("1",(200,40))
draw = ImageDraw.Draw(image)
draw.text((0,0), text, font=fnt, fill=1)
image.save('text.png')


More information about the Image-SIG mailing list