[Image-SIG] Freetype with advanced typographic options

Medhat Assaad medhat_assaad at yahoo.com
Tue Mar 21 19:11:38 CET 2006


I am trying to use PIL to find the length of some
Arabic text. These fonts usually use the open type
tables, and freetype supports that as per
This is not working for me using PIL 1.1.5 on windows.
I tried to create an image with the text I was trying
to measure its length, and it used the correct font
but it did not use the open type tables and it did not
do the shaping of the arabic font (ligature
substitution). Is there any way to get this working on
windows? Without having to recompile stuff... I am
hoping to find a precompiled package of PIL that will
support that since I will not be able to compile it on
my machine.

Here is my small test program (probably you will need
to change the font if you want to test it)

import Image,ImageFont,ImageDraw,ImageColor

im = Image.new("RGB",(500,500),"white")

draw = ImageDraw.Draw(im)
f = ImageFont.truetype("arabtype.ttf",48)

Medhat Assaad

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the Image-SIG mailing list