Re: PangoFontMetrics



"Venkat Ramakrishnan" <venkat_ramakrishnan hotmail com> writes: 
> Thanks a lot for the help . I am using pango_layout_get_extents()
> but I think using the above call I can get the width and height
> of the string I am using but not the ascent and descent .
> 
> Please correct me if I am wrong but ascent and descent is different
> than the height ...and to get the ascent and descent i got to use
> the PangoMetrics (is it??).

If you need ascent/descent probably you could get the PangoLayoutLine
from the layout and get the geometry of the lines. The extents of the
line are given relative to the baseline, so the Y value is "-ascent"
essentially. Also if you use PangoLayoutIter you can iterate over the
lines in the layout and get the baseline of each one.

Out of curiosity, what are you using ascent/descent for?

> I have one more doubt  ..how does the Layout know about the font being
> used , because the height/width etc for the string will depend
> on the font being used. I did a pango_load_font ..is that correct ??

The font comes from the PangoContext used to create the layout by
default, and can be overridden with a PangoAttrList. You should not
need to call pango_load_font(), you should only need to provide a
PangoFontDescription to PangoAttrList, for a non-default font.

Havoc



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]