[reportlab-users] TTF fontname issue with blanks?!

Robin Becker robin at reportlab.com
Tue Mar 13 09:33:43 EDT 2007


Dinu Gherman wrote:

> Robin Becker:

>

>> You're probably right about the rewrite, but the main issue is whether

>> the space character can be part of the postscript name. Not having

>> written the code it's impossible to be completely sure why the space

>> was included, but I can guess that spaces are not allowed in legal

>> postscript identifiers so may be inapplicable in font identifiers for

>> postscript printers. Probably that test is only applicable if you're

>> going to run the font in postscript (already a hard problem for ttf

>> fonts).

>

> In my case the font is printed fine on my HP LaserJet 2100 TN, an

> ancient PostScript printer. I think Marius Gedminas wrote the code.

> Maybe he can comment on it if he's still reading this list. I can

> provide the font for testing, if needed.

>

> Dinu


If you are writing via reportlab's pdf output then it's likely we create an
internal subset font and that gets used in the print. If we were doing this via
real postscript it'd be more of a test.

In renderPS.py our font names are being specified like this

'WinAnsiEncoding /%s /%s RE' % (fontName, fontName)

in one place and like this

'(%s) findfont %s scalefont setfont' % (psName,fp_str(self._fontSize))

in another; the latter will likely be OK, but the former seems unrobust. I'm not
enough of a postscripter to say.
--
Robin Becker


More information about the reportlab-users mailing list