[cairo] text measuring speed

Keith Packard keithp at keithp.com
Sat Jun 11 10:54:57 PDT 2005

On Sat, 2005-06-11 at 13:24 -0400, Jon Smirl wrote:

> Wouldn't it be cleaner to remove all direct access to freetype from
> Pango and use Cairo instead? That would make it transparent to pango
> when switching from win32/PDF/xft.

Cairo would then need to provide a complete font access API, including
access to alternate font tables and the like.  Attempting to wrap the
FreeType (or Win32 font API) in an abstraction is both too hard and not
very future-proof.  So, instead we require that upper level layout
libraries provide suitable back-ends for each operating system.  This
design was driven by application developer requests, so it's not purely
laziness on our part.

> So why does Cairo have a performance problem with GetTextExt(), isn't
> it just a thin wrapper for GetTextExt() being supplied by
> xft/PDF/Win32? Cairo would cache the glyph info and return it as
> needed.

It's purely a matter of the coordinate system transformation; glyph
metrics are represented as bounding boxes in the users coordinate space,
glyphs are stored in the font-backend in the native device coordinate
space.  Converting from one to the other turned out to be a significant
performance problem.

None of this has any bearing on the performance of text through either
Glitz or the Render extension as those work purely in device space.


-------------- 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/3e7eea1f/attachment.pgp

More information about the cairo mailing list