[Image-SIG] Freetype with advanced typographic options
Medhat Assaad
medhat_assaad at yahoo.com
Tue Mar 21 19:11:38 CET 2006
Hi,
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
http://www.freetype.org/opentype/index.html
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)
draw.text((10,10),u"\u0627\u0628\u0627",font=f,fill="black")
im.save("im.png")
---%-------------
--
Thanks!
Medhat Assaad
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the Image-SIG
mailing list