[reportlab-users] Reportlab 2.0 Paragraph using <b> with ttf-fonts, HOW?

Harald Armin Massa haraldarminmassa at gmail.com
Thu May 3 15:33:42 EDT 2007


Hello Andy,

You now have 4 registered fonts. The next step is to associate them

> into a family. You use addMapping(family, bold, italic, fontName)

> e.g.

>

> from reportlab.lib.fonts import addMapping

> addMapping('Vera', 0, 0, 'Vera') #normal

> addMapping('Vera', 0, 1, 'Vera-Italic') #italic

> addMapping('Vera', 1, 0, 'Vera-Bold') #bold

> addMapping('Vera', 1, 1, 'Vera-BoldItalic') #italic and bold

>

> It's a bit clunky - I am working on a 'fontfinder' which can trawl

> directories and organise fonts into families like this for you.

>


oh, once you know how it is done, it works quite well! Maybe you can add
those lines to paragraph.py docstring?

One thing that bothers me is th rather strict and ancient idea of a family

:) ... as long as they are not all members present, <b> fails without any

message whatsoever :(

(That is, if only the mappings for normal and bold are present, no <b> gets
evaluated)

...of course, it's possible to work around by just adding fake mappings.

Thank you very much for the quick information,

Harald



--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
0173/9409607
fx 01212-5-13695179
-
Python: the only language with more web frameworks than keywords.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20070503/75c49dbb/attachment.html>


More information about the reportlab-users mailing list