[reportlab-users] Using bold and italic with a generic TTF

Andy Robinson andy at reportlab.com
Mon Mar 12 19:39:49 EDT 2007



> both places. So, they're using the roman font all through this. To

> draw the italic text, they set a transform matrix for text to draw it

> skewed (using Tm), and then place each character individually.


I wonder if the individual placing is necessary, or just an artifact of
their own algorithm? It seems to me that a basic skew would do the job
and would not adjust letter spacing, so metrics would be unaffected
(except for a fraction of a character at the end of a string).

> To draw

> bold text, they change the rendering mode to stroke/fill and alter the

> line width.

Even neater. Never thought of that.


> Now, glossing over the fact that the text rendering code in ReportLab is

> already complicated, this shouldn't be too hard to add. A suitably

> motivated individual with a week to spare should be able to do it.


Yes, it sparks quite a few ideas. One could synthesize "fonts" with
outlines, height and spacing adjustments. In fact I think that's what
Acrobat does when it doesn't have the right font files.

It does however involve modelling things in more detail which would be a
performance hit, at least when it's used.

- Andy



More information about the reportlab-users mailing list