[reportlab-users] Bug when importing TrueType fonts with names containing blanks

Robin Becker robin at reportlab.com
Thu Nov 29 14:29:45 EST 2007


Tim Roberts wrote:

> Dinu Gherman wrote:

>> Hi,

>>

>> I'm getting an error when trying to use TrueType fonts containing

>> blanks in their font names. See the following traceback:

>>

>> Traceback (most recent call last):

>> ...

>> reportlab.pdfbase.ttfonts.TTFError: psName='UniversalCondensed

>> Regular' contains invalid character ' ' ie U+0020

>>

>> I can workaround this with the following simple minded patch to

>> reportlab/pdfbase/ttfonts.py, but I'm not sure if this is a proper

>> solution:

>

> No, it's not, because it's not necessary. Remember that the font name

> you pass to TTFont does not have to be related to the actual font name

> in any way. It is just an alias that you use to refer to the font in

> future canvas.setFont commands. If you want to think of it as "UCR",

> you can do that. If you want to use the hyphenated name, then pass

> UniversalCondensed-Regular to TTFont. It's up to you.

>


I think we can replace the space with a suitable character, but are we
entitled to?
--
Robin Becker


More information about the reportlab-users mailing list