Writing Latin text on an image using PIL is easy.
However, when I try to write Hebrew punctuation marks (called "nikud" or
?????), the characters does not overlap (as it should).
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,the error
(latter example) occurs in all the ttf fonts I have installed (200+)
beside DejaVuSans.ttf and Lucida*.ttf, on which it works OK.
See example as an image (url: http://tinypic.com/r/jglhc5/5)
<http://tinypic.com/r/jglhc5/5>
See differences in rendering among various fonts
http://tinypic.com/view.php?pic=sgiu1i&s=3
<http://tinypic.com/view.php?pic=sgiu1i&s=3>
I guess this question is relevant also to Arabic and other similar
languages with overlapping characters.
Note:
there's also a "bug" (or an unimplemented feature) not dealing with
bidirectional (bidi-, RTL) fonts. Meaning, Hebrew text on the image is
printed backwards. But that's another issue.
Here's my original discusstion on StackOverflow:
http://stackoverflow.com/questions/993265/writing-text-with-diacritic-nikud-vocalization-marks-using-pil-python-image
_______________________________________________
Image-SIG maillist - Image-SIG@python.org
http://mail.python.org/mailman/listinfo/image-sig