[cairo] Fwd: Re: Uniform Line Widths

Bill Spitzak spitzak at thefoundry.co.uk
Fri Feb 22 17:06:52 PST 2008

Behdad Esfahbod wrote:

>>> Fixing this for text is even trickier.  When do you lock the ctm?!  At
>>> cairo_set_font_size(), sure.  At cairo_set_font_matrix() too?!  That
>>> kinda doesn't sound right, but makes some sense...  I'll discuss that
>>> more when we consider this change...
>> I'm pretty certain it would be done at the time of the set_font_matrix.
>> I believe font_size should be a convinence wrapper over this, just as
>> you are proposing for the pen.
> Problem with it is, people expect that sandwiching between
> "cairo_save(); cairo_scale(2,2);" and "cairo_restore()" should make it
> draw twice bigger text.  If we lock, that wouldn't happen.  Donno.

I don't understand this. I also expect twice-bigger text if the 
set_font_matrix is put at the point like you suggest. As I see it, the 
matrix given to set_font_matrix() is immediatly multiplied by the ctm 
and only that result is stored and used from then on to transform glyphs 
to the output surface, thus I also think the resulting matrix is locked 
at that point.

The request for the font matrix has to divide the stored constant matrix 
by the ctm.

More information about the cairo mailing list