[reportlab-users] Font re-registration annoyance

Robin Becker robin at reportlab.com
Fri Jan 12 13:08:20 EST 2007


Dinu Gherman wrote:

> Hi!

>

> I have some code which might try to register a TrueType font

> multiple times. It's more convenient like this, although my code

> could be smarter an avoid registering the font more than once.

>

> Without that smarts I get the traceback below for the attached

> code snippet, which does surprises me a bit. While I can change

> my own code to handle this, I might not be able to change code

> from others that uses fonts inside external Platypus flowables.

>

> Therefore, I think that detecting the re-registration of a font

> might be something to be moved / developed into the RL code base

> itself.

>

.......

you're probably right. The TTF code does it's own internal sub-setting with the
internal name of the font as part of the subset name. Using the same font
multiple times causes problems because we don't have a cache for those fonts.

I guess that TTFont itself could do that and avoid rereading all the data etc
etc. Probably we need to allow some kind of family information to be used so
linked fonts could find each other. Sounds like reinventing the wheel all over
again.
--
Robin Becker


More information about the reportlab-users mailing list