[reportlab-users] Font Helvetica always used?

Robin Becker robin at reportlab.com
Fri Jun 19 05:58:13 EDT 2015


On 19/06/2015 10:16, Andy Robinson wrote:
> If this is causing printers to complain about embedded fonts, then we
> need some way around the problem.
>
> I wonder if we could internally keep a little set or dictionary of
> fonts that were actually used (by calls to setFont), then remove any
> that are not at the end when writing the PDF?  It would be a lot
> simpler and would involve no API changes or weird setup incantations
> for users.
>
> - Andy
......
in fact it's not the setFont that does the deed it's _make_preamble which we use 
to initialize stuff before anything has been done on a given page. PDF has 
defaults built in so we have to have a font in case we don't use setFont.

We could of course delay setting any font until use in textobject, but I think 
that would complicate things even further.

It would be easier just to make fontname, fontsize & leading available in Canvas 
__init__. If we do that they should be obviously initialization values eg 
initial_fontName,... so there's no confusion with the actual current attributes.
-- 
Robin Becker


More information about the reportlab-users mailing list