[cairo] Text metric adventures

Owen Taylor otaylor at redhat.com
Tue Dec 28 08:05:56 PST 2004

On Mon, 2004-12-27 at 01:30 -0800, Keith Packard wrote:
> Ok, I think I've figured some things out about text metrics and text 
> drawing.  Let me try to explain what I know and then we'll figure out 
> where to go from there.
> The first thing to realize is that PostScript cleverly (as always) defines 
> away the transformation issues by having all text metrics reported in 
> "glyph space" -- that abstract space within which glyphs are drawn.  This 
> means that any font transformation has no effect on the metrics seen
> through the (limited) extent functions, not even a font scale factor.
> The second thing to realize is that FreeType "mostly" ignores the
> transformation matrix when returning metrics as well.  The only place where
> the transformation is used is in computing the returned advance amounts,
> however, the untransformed advance values remain available across that
> interface, so all we have to do is use them instead and we've got
> completely transformation independent metrics. As the FreeType cairo
> interface separates the scaling portion of the overall glyph
> transformation, and as FreeType *does* respect that in the metrics, 
> getting the 'glyph space' metrics is a simple matter of dividing the 
> scale factors from the FreeType metrics.

What about rounding advances to integer pixel amounts when hinting? If
don't do that and instead round positions for each glyph individually
get different results than Xft, etc. 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20041228/8da60c04/attachment.pgp

More information about the cairo mailing list