[Image-SIG] Garbled Text

Tim Flink tim at mail.mew.co.jp
Wed Feb 21 07:23:56 CET 2007


I'm having an issue with garbled fonts and I was hoping that someone
might have some suggestions on how to fix them.

I'm trying to write some text (both Japanese and Roman characters) using
Japanese fonts, but the output is just a random string of lines if I am
below a specific size (18 for ipag-mona and 24 for msgothic). I don't
seem to have this problem if I print roman characters using a common
font (Arial for instance). Nothing seems to change even if I use the
"encoding= <insert encoding here>" with the ImageFont.truetype()
constructor.

I have included some example code that creates 8 small bitmaps. 4 with
Japanese characters using various font sizes and 4 with roman characters
using various font sizes.

Can anyone see something wrong with my code or have a suggestion for a
different way to do this?

Thanks,

Tim

msgothic.ttc comes with the east asian language package for MS Windows
(XP at least, I don't know about other versions).
ipag-mona.ttf can be downloaded from the following site:
http://www.geocities.jp/ipa_mona/

Code was written for Python 2.5 and PIL 1.1.6 (downloaded binary for
Win32 and Python2.5) under Windows XP SP2, Japanese Language Edition

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: imageTextIssue.py
Url: http://mail.python.org/pipermail/image-sig/attachments/20070221/ce06ef27/attachment.asc 


More information about the Image-SIG mailing list