[cairo] Pango cairo target surface size

Rob Kramer teegee at gmail.com
Sun Mar 22 19:46:11 PDT 2015


Hi all,

I would like to create a cairo image surface that is equal to the 
logical extents of a text string. This seems to be a chicken-and-egg 
problem, since I need a cairo_t with surface before I can use layout 
functions (and the surface size isn't known yet).

If I use plain Pango to calculate the extents beforehand, then the 
layout calculations have to be done twice, since Cairo pango will do 
them again.

Is there a better way to do this?

Cheers!

     Rob


More information about the cairo mailing list