[reportlab-users] warnOnMissingFontGlyphs does not work?
Gábor Farkas
gabor at nekomancer.net
Mon Jun 19 08:24:42 EDT 2006
hi,
i have a simple script, like this:
==============================================================
import reportlab.rl_config
reportlab.rl_config.warnOnMissingFontGlyphs = 1
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfgen import canvas
pdfmetrics.registerFont(TTFont('arial', 'arial.ttf'))
c = canvas.Canvas("hello.pdf")
c.setFont('arial', 32)
c.drawString(10, 150, "some text with missing glyphs")
c.showPage()
c.save()
===============================================================
(the text contains some japanese characters that are not in arial.ttf)
i assumed that i get a warning, or an exception, but nothing.
the script finished without problems,
but in the pdf file (of course), there were only the usual rectangles in
the place of the missing glyphs.
could you please tell me what am i doing wrong?
also, is there a way to specify more fonts, and somehow combine them so
that reportlab picks the needed glyph from them? i mean, so that for
example, arial.ttf will be the default, but when a glyph is missing, he
takes it from kochi-mincho.ttf.
thanks,
gabor
More information about the reportlab-users
mailing list