[Cairo] Re: [xsvg] cairo_text_extents ?

Christof Petig christof at petig-baender.de
Wed Nov 26 23:41:07 PST 2003

Bill Spitzak schrieb:
> I have gotten zero response to my proposal that there be two matricies, so 
> that the y_advance can be defined as zero, and the user can choose exaclty 
> what coordinate system the metricies are returned in. Has anybody read it? Is 
> it a stupid idea, or why isn't anybody saying anything?

I had some difficulties understanding your exact proposal. Am I correct 
to assume that you want individual glyph transformation and text 
(advance) direction transformation to be independant. (e.g. drawing 
left-to-right text top-to-bottom or writing mirrored/flipped glyphs in a 
normal direction or positioning upright letters along a diagonal line.)

I really like this.

The only extension I might envision is to place text along a curve. 
(with or without glyph rotation). [I use this regularly in DTP.]

> In my opinion the zero-y_advance idea will work, so imagine the second 
> drawing of vertical text rotated sideways so the "advance" is in the x 
> direction, and X and Y and width and height have been swapped in all the 
> names, and yMin and yMax have been swapped. It is then identical except 
> bearingY is in the opposite direction.

I think that if you want to draw CJK fonts you need vertical advance. If 
you map vertical advance to horizontal advance you will get wrong spacing.

BTW: Vertical advance information for ltr/rtl fonts or horizontal for 
ttb is another issue (perhaps the bounding box is the best information 
we have). This would make the text direction transform somewhat 
different from normal transforms (an elliptical rotation without 

E.g. if you draw upright characters at 45° you would compute a decent 
y_advance (e.g. by bounding box) and take 0.70 of y_advance for y and 
0.70 of the font's x_advance for x.


More information about the cairo mailing list