[reportlab-users] Fwd: Font size, baseline and typography stuff

Dinu Gherman gherman at darwin.in-berlin.de
Tue Aug 16 03:17:17 EDT 2011

"Andy Robinson" <andy at reportlab.com>:

> On 15 August 2011 09:08, Dinu Gherman <gherman at darwin.in-berlin.de> wrote:

>> So I looked into the file rl_config.py, but it doesn't

>> help much to find out which font file is really used in

>> the end when I give a name like "Times-Italics". Is there

>> any method of finding this out without analysing the

>> whole code?


> It won't help even to analyse the code!


> If you use one of the standard Postscript font names, then

> the PDF viewer (Acrobat Reader, evince or whatever) decides

> which actual font file to use. Our code simply doesn't know.

> We are using canned text metrics taken originally from the standard

> fonts which used to ship in early versions of Acrobat Reader when

> RL was first launched.

Interesting, or scary... or both. In fact, I've temorari-
ly uploaded some PDFs in this archive here which are dis-
played differently, indeed, when opened in Preview.app or
Adobe Reader 9.1 (2.3 MB):


At least they look the same with Adobe Reader 9.1 on Mac
and Windows XP. But, still, funny interpretation of the
term "standard", I guess.

Even with Adobe Reader there are slight differences be-
tween the single characters and the paths drawn on top.
So I wonder if these typefaces/paths evolved since you
first grabbed them in the early days of ReportLab, Ltd?

> If you use the getBounds feature in the graphics, or indeed you try

> to create output to formats other than PDF, it requires that you

> have installed some font files, (the infamous 'pfdfer.zip') which, as far

> as we know, are the same ones that were used back then. We need

> actual font files for the FreeType engine to work on.


> If you register your own font file (PS or TT) then of course you know

> which file you are using and this is the approach I would strongly

> recommend if you want to get accurate typography.

Right, sounds like good advice, thanks!

BTW, if you want to include the code into your test
suite, feel free!



More information about the reportlab-users mailing list