[cairo] Re: What are the unit of the height field in font_metrics_t?

graydon hoare graydon at redhat.com
Tue Oct 12 11:09:21 PDT 2004


Richard Cole wrote:

> I added this program to cairo-demo/cairo_snippets, ran make and then 
> "./cairo_snippets_png". The height being returned is: 89.400000, but the 
> font in the rendered image looks to be roughly 0.3 in user co-ordinates. 
> So what are the units of font_extents.height and how do I convert these 
> to user space? Is there any documentation, even a specification, of the 
> behaviour of the cairo_current_font_extents function?

that's odd. I get the following output:

TRACE: Font height=0.433594
TRACE: Font height * font_scale=0.130078

which is not stunningly different from I'd expect, given the distortion 
of the user coordinate space in the snippets code, and the 
not-always-very-precise match between requested font size and delivered 
font size. perhaps there is some sort of error causing that to diverge 
from 0.3 more than necessary, of course.. but, are you sure that was the 
entire snippet you ran?

-graydon



More information about the cairo mailing list