[Cairo] Re: [xsvg] cairo_text_extents ?

Turner David dturner at cptechno.com
Wed Dec 3 00:38:01 PST 2003


> 1. The main difference is that in my scheme, while the glyphs 
> are transformed by exactly the concatenation of the matrices, the "advance" 
> values are instead calculated by the font based on the font_matrix, in possibly 
> font-specific ways. In particular it cannot have a non-zero 
> y_advance and thus the advance cannot rotate even though the font transform 
> can. Also if the font defines a "vertical advance" value then when it is 
> rotated 90 degrees the x_advance should change to this value. Also the 
> exact point rotated around should be decided by the font, so that as  you 
> rotate the letters it smoothly transitions from horizontal to vertical 
> layout (this rotation point can be figured out for each letter from a font 
> description that has both horizontal and vertical metrics).
> In the cairo design I have no guaranteed way to make 
> y_advance be zero. Even if I don't rotate the font transform the interface seems to 
> allow the font to set it non-zero, perhaps due to internal rounding to pixels 
> when the main transform is rotated. I want to be able to *guarantee* (by 
> making it not exist in the interface) that y_advance is zero. If this is 
> not forced, there are two ways to lay out tilted text (rotate the 
> text_transform, and rotate the font_transform), where the advance values may be 
> calculated differently (one by the font and the other by the calling program), and 
> thus output text will not match between them, which is a bad thing that Cairo 
> is supposed to fix.

Unfortunately, you cannot have a single advance value, since certain scripts
really require both x and y. For example, have a look at the Nastaliq screenshots
at the following page:


Not to say that using two matrices isn't a good idea, just that the specific "advance"
advantage isn't valid.


- David Turner
- The FreeType Project  (www.freetype.org)

This message and any attachments (the "message") is intended solely for the
addressees and is confidential. If you receive this message in error, please
delete it and immediately notify the sender.
Any use not in accordance with its purpose, any dissemination or disclosure,
either whole or partial, is prohibited except formal approval.
The E-Mail transmission can not guarantee the integrity of this message.
CANAL+TECHNOLOGIES will not therefore be liable for the message if modified.

More information about the cairo mailing list