[Cairo] Re: [xsvg] cairo_text_extents ?

Owen Taylor otaylor at redhat.com
Tue Dec 16 13:47:42 PST 2003


On Tue, 2003-12-16 at 10:49, Carl Worth wrote:
>  significant difference is that freetype actually provides only a
> single advance value. Freetype does have separate horiAdvance and
> vertAdvance values, but also separate horiBearingX and horiBearingY
> values.
> 
> We already have a plan for teaching cairo how to know whether it
> should get the horizontal or vertical set of metrics from
> freetype. So, it's conceivable that we could provide a single advance
> value rather than x_advance and y_advance, (at least as far as
> freetype is concerned).
> 
> Would that actually be useful? Would it limit things somewhere?

Well, a y-advance value roughly matches the way that Postscript 
handles vertical text, so I guess that's an advantage. It's not
what I'm going to do for Pango, however.

The Pango approach is going to be that lines of text always 
proceed in the positive-X direction. Vertical text will involve
a 90 degree rotation of Han characters during layout so they
get rotated back into vertical by the overall matrix.

This should considerably simplify the bookkeeping.

I think it's very much worth reading the appropriate parts of
the CSS3 text module:

 http://www.w3.org/TR/css3-text/

before designing any API with the hope that it is going to work 
well for vertical text. I also tend to think that vertical text
is well out of the scope of what should be in the "toy api".

Regards,
					Owen






More information about the cairo mailing list