[cairo] text measuring speed

Owen Taylor otaylor at redhat.com
Sat Jun 11 08:56:28 PDT 2005


On Sat, 2005-06-11 at 11:39 -0400, John Ellson wrote:

> +1 on this question.
> 
> In graphviz I need font resolution and text metrics during the layout 
> stage, but at that point
> it isn't yet known if cairo is even needed for the backend rendering.  

Pango can't meaningfully tell you metrics until you tell it what backend
you are targeting ... how hinting occurs determines on the details of
the output device.

It *is* painful that the Pango/Cairo API is designed around having a 
cairo_t (and thus a surface) when you create a PangoLayout. Right now
you can basically bypass this by not using the convenience functions
and calling pango_context_set_matrix() directly, but I'm not sure how
it's going to work when we properly distinguish pixel-based and
non-pixel-based output devices.

> OTOH.  It would be nice if any font-related caches populated during  the 
> layout phase could be
> useful to cairo during rendering....   So if the reason for cairo-based 
> text-metrics is to reuse
> the caches, then that would justify it for me.

That's the basic reason ... yes. We don't want to have to hint glyph
outlines twice. But even if Pango did the metrics itself, that wouldn't
get us around the deep connection between font handling in the two
systems ... PangoFcFontMap is just an abstract base class ... to make
it usable, you need to use a subclass such as a PangoXftFontMap or
PangoCairoFcFontMap

Regards,
						Owen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050611/ac1f7f35/attachment.pgp


More information about the cairo mailing list