[cairo] Locking font / pen space

Behdad Esfahbod behdad at behdad.org
Mon Aug 30 09:01:40 PDT 2010


On 08/27/10 16:37, Bill Spitzak wrote:
> 
> I would prefer it to not be reset by changing the font/pen.

Resetting is needed to preserve backward compatibility with old code.  Say, I
have a library function foo_draw(cairo_t *cr).  foo_draw sets font, stroke,
etc, then magnifies depending on a requested magnification level, and draws.
This should not break, ever.  If the caller locks the font space and the lock
doesn't release upon setting the font by foo_draw(), that function breaks.

Preserving backward compatibility was the whole point of proposing this API.

behdad


More information about the cairo mailing list