[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.11 TTF_FontAscent

int TTF_FontAscent(const TTF_Font *font)

font
The loaded font to get the ascent (height above baseline) of.

Get the maximum pixel ascent of all glyphs of the loaded font. This can also be interpreted as the distance from the top of the font to the baseline.
It could be used when drawing an individual glyph relative to a top point, by combining it with the glyph's maxy metric to resolve the top of the rectangle used when blitting the glyph on the screen.

rect.y = top + TTF_FontAscent(font) - glyph_metric.maxy;

NOTE: Passing a NULL font into this function will cause a segfault.

Returns: The maximum pixel ascent of all glyphs in the font.

 
// get the loaded font's max ascent
//TTF_Font *font;

printf("The font ascent is: %d\n", TTF_FontAscent(font));

See Also:
3.3.10 TTF_FontHeight,
3.3.12 TTF_FontDescent,
3.3.13 TTF_FontLineSkip,
3.3.19 TTF_GlyphMetrics



This document was generated on November, 13 2009 using texi2html