[cairo] Cairo 1.9.2 performance

cu cairouser at yahoo.com
Thu Jun 18 05:49:02 PDT 2009


Chris Wilson wrote:
> cairo_show_text() is the toy text interface interface, which now lazily
> resolves the font (if it has been changed on the context) on every call
> (since the resolved font can in fact change between calls). Consider
> this a strong hint not to use this in a non-demonstration application
> and use a full layout library like Pango instead. 
>   
Since the "toy" designation was removed from the font API calls, I am
not entirely sure why it is now less recommended for use than before.
Using Pango (or any other additional API for that matter) would make our
application even less portable and, in any case, is a significant
overkill for the text functionality we need, so that's not really an
option.
> Alternatively you can always query the font chosen for a particular
> face, family, size, slant and weight by calling
> cairo_get_scaled_font(cr) after setting up the font parameters. Then to
> restore that particular resolved font, use cairo_set_scaled_font().
>   
I will make a note of that and test this approach at some point.

What is the reason for this change of text API behavior? I don't suppose
the slow-down is intentional?




More information about the cairo mailing list