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

Andy Robinson andy at reportlab.com
Mon Aug 15 05:30:06 EDT 2011

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.

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.

- Andy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_nanotypometrics.py
Type: text/x-python
Size: 6055 bytes
Desc: not available
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20110815/f59e6b68/attachment.py>

More information about the reportlab-users mailing list