[reportlab-users] canvas change

Robin Becker robin at reportlab.com
Tue Mar 6 10:46:27 EST 2007


A long standing bug in the canvas has been fixed and at the same time the
standard initial font was changed.

The previous situation was as follows.

In the canvas __init__ the initial graphic state was set up with
_fontname='Times-Roman' in init_graphics_state and then in the _make_preamble
method I carefully set up the initial font to be 'Helvetica'.

The problem occurs when you use the canvas without setting your own font;
basically you get the default Helvetica until you explicitly change font or
until you use a character that needs a replacement from say symbol. When that
happens you get switched back not to Helvetica, but to Times-Roman and you stay
there.

I have switched the order of statements in __init__ so the initial graphics
state is computed and then _make_preamble can use self._fontname. Andy
explicitly wanted 'Helvetica' so the graphics state now uses that.

If you liked 'Times-Roman' you should already have had to set up the font
explicitly as you will have observed the erroneous behaviour. If you liked
Helvetica we have fixed a possible bug and made that the default.

-Mea Culpa Mea Culpa Domine exculpe me'ly yrs-
Robin Becker


More information about the reportlab-users mailing list