Re: Text size, height ascent, descent documentation



Hi,

> I am searching for a documentation on how to set the size of text to get
> for example a text of 20 pixels height on screen. Further on I am
> searching for information how to get the ascent and descent values.


In the meantime I figured out some things by my self...

I able to get ascent and descent and the resulting height of the text,
but I could not figure out the realtion between this values. I would
expect that "ascent + descent = size of text", but I got with
FONT="serif" and
pango_font_description_set_absolute_size (desc, size * PANGO_SCALE);

the following results:

size=10, ascent=10, descent=3, resulting text_height=13
size=20, ascent=19, descent=5, resulting text_height=24
size=30, ascent=28, descent=8, resulting text_height=36
size=32, ascent=30, descent=8, resulting text_height=38

(resulting text_height from
pango_layout_get_size (layout, NULL, &text_height); )

Is it possible to calculate the value of "size" from a wanted "text_height"?

regards

 W. Holzke


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