[Image-SIG] Writing diacritic marks (nikud) using PIL text draw

yalla balagan yallabalagan at gmail.com
Sun Jun 14 19:59:45 CEST 2009


Writing simple text on an image using PIL is easy:

draw = ImageDraw.Draw(img) draw.text((10, y), text2, font=font,
fill=forecolor )

however, when I try to write Hebrew punctuation marks (called "nikud" or
ניקוד), the characters does not overlap as it should. I guess this question
is relevant also to Arabic and other similar languages.

On supporting environment, these two words take up the same space/width (the
below example depend on your system, hence the image):

סֶפֶר ספר

However when drawing the text with PIL i'd get

ס ֶ פ ֶ ר

since the library probably doesn't obey kerning(?) rules.

Is that all possible without writing manually character positioning?

image url: http://tinypic.com/r/jglhc5/5
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/image-sig/attachments/20090614/ef3d83fd/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nikud.png
Type: image/png
Size: 1049 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/image-sig/attachments/20090614/ef3d83fd/attachment.png>


More information about the Image-SIG mailing list