[Cairo] Re: [xsvg] cairo_text_extents ?

John Ellson ellson at research.att.com
Tue Nov 25 14:50:16 PST 2003

John Ellson wrote:

> Carl Worth wrote:
>> > First, I'm uncomfortable with the need to multiply by the original 
>> fontsize
>> > in xsvg.c.  I think it would be better if the units returned by 
>> the  > text_extents functions were those of the model.
>> All of the values at the cairo interface are in user space
>> coordinates. So, if you're dividing by font size after
>> cairo_text_extents, then it's not returning the right thing yet.
> Multiplying actually, but we agree that its not right.

Just to clarify this.   Because I wasn't able to get at either the 
current fontsize, or
the current zoom factor, in the extents code, so I divided the extents 
by the current
composite scale before return.  This has the effect of normalizing the 
extents to a
1pt font and a 1:1 zoom.   Then just multiplying by the fontsize on the 
user side
gives back the correct units.

Access to either fontsize, or zoom factor, would allow the problem to be 


More information about the cairo mailing list