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

Tim Roberts timr at probo.com
Thu Nov 29 14:20:29 EST 2007


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.

--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the reportlab-users mailing list