[Cairo] Re: [xsvg] cairo_text_extents ?

Carl Worth cworth at east.isi.edu
Tue Dec 16 08:58:19 PST 2003


On Dec 16, Trevor Woerner wrote:
 > For western scripts written horizontally (i.e. plain writing with no 
 > transforms) how would we know where to start the next line below the 
 > current line without y_advance?

y_advance doesn't have that information anyway. Look for the height
field in cairo_font_extents_t instead.

 > By the way, is there a way to get these metrics for each character of a 
 > typeface individually? Code which lays out text one character at a time 
 > looks fine when using monospace, but ugly when using, say, serif.

Sure. Just call cairo_text_extents or cairo_glyph_extents with a
single character. There's even an example of this in
cairo-demo/png/text.c.

-Carl




More information about the cairo mailing list