[Cairo] Re: [xsvg] cairo_text_extents ?

Keith Packard keithp at keithp.com
Tue Dec 16 12:59:56 PST 2003

Around 10 o'clock on Dec 16, Carl Worth wrote:

> In fact, I'm leaning far enough that I just committed the following:
> 	typedef struct {
> 	    double x_bearing;
> 	    double y_bearing;
> 	    double width;
> 	    double height;
> 	    double x_advance;
> 	    double y_advance;
> 	} cairo_text_extents_t;

'width' is a very confusing term; it often is taken to mean 'x_advance', 
and for many fonts the values are often quite close, making it possible to 
commit errors that don't show up in early testing.

> I haven't written much text manipulation code, but the little bit of
> code I have written in libsvg-cairo actually suggests to me that
> having separate x_advance/y_advance values actually makes things
> easier, (even if at most one of the values will be non-zero). It seems
> to allow me to write code that can correctly align text without having
> to check whether the font is vertical or horizontal.

Me too!  (/me wears the sign of the L)


More information about the cairo mailing list