[reportlab-users] Fonts with missing glyphs

Andy Robinson andy at reportlab.com
Thu Sep 25 17:16:25 EDT 2008


2008/9/25 Roberto Alsina <ralsina at netmanagers.com.ar>:

> >From a rst2pdf user's request:

>

> Sometimes a glyph is not available in a specific font. For example, unicode

> box drawing characters are not in Courier. Is there a way reportlab could give

> a warning if it's being asked to draw a glyph in a font that doesn't have it?


We thought about this, and even looked at situations where we
invisibly 'switch font' on the fly. I see 2 problems

(1) string-drawing is key to perforrmance. Checking every drawString
call might be slower, unless we increased our dependency
on C. (It would be cheaper to check when the document is saved, or
keep a set of characters seen in each font, so at least we could warn
people).

(2) worse, we don't actually know what's in YOUR copy of Courier.
That's a feature of the version of Adobe Reader, or its competitors,
which you use to view the PDF. I've seen files with, say, Serbo-Croat
accents which are readable in a Bosnian version of Adobe Reader, but
show as black blobs in a US English one. Same file, same (alleged)
font. Now we have moved to unicode input, we have to assume all
characters are valid input. (It would have been easier prior to 2.0
when we often knew the character set of the font).

- Andy


More information about the reportlab-users mailing list