[reportlab-users] renderPM erro

Andy Robinson andy at reportlab.com
Fri Feb 24 05:21:06 EST 2006


ÁõÓÚÖÞ wrote:
> hi:
>   I am chinece,so i user chinece Font.I user reportlab create chinese 
> font image.but i have a problem on Linux OS, win2000 no this problem.
>   My Reportlab version is 1.20,renderPM is 1.00,PIL is 1.1.5 and 
> Python24.  I write a python scripts file to create gif image file,following:
> from reportlab.graphics import renderPM
> from reportlab.pdfbase import pdfmetrics
> from reportlab.pdfbase.ttfonts import TTFont
> pdfmetrics.registerFont(TTFont('ºÚÌå', '/.../Fonts/simhei.ttf')) # which 
> my fonts path,and simhei.ttf is exsit,I sure.

The font library we use seems to fail on the equivalent Japanese TTF
files (msgothic.ttf and msmincho.ttf) and I don't believe renderPM works
with Asian fonts.  However, this is one of the last couple of things we
are trying to fix in our Unicode-aware "version 2.0" code which should
be out (at least in beta) next month.

The error message is misleading; what's happening is that Asian ttf font
files have a slightly different structure to the Western ones we have
tried - some extra or missing declarations at the top of the file, I
think - and some of the libraries trying to parse the font go wrong.

If you can shed any light on this it would be really helpful - I'm
working on exactly the same problem for Japanese, and we have a Chinese
employee now who wants to fix it for you!

Best Regards,


Andy Robinson


More information about the reportlab-users mailing list