Tao.Sdl SDK Documentation |
|
SdlTtf.TTF_FontHeight Method
Get the total height of the font - usually equal to point size
[Visual Basic]
Public Shared Function TTF_FontHeight( _
ByVal
font As
IntPtr _
) As
Integer
[C#]
public static
int TTF_FontHeight(
IntPtr font);
Parameters
-
font
- The loaded font to get the max height of
Return Value
The maximum pixel height of all glyphs in the font.
Binds to C-function in SDL_ttf.h
int TTF_FontHeight(TTF_Font *font)
Remarks
Get the maximum pixel height of all glyphs of the loaded font. You may use this height for rendering text as close together vertically as possible, though adding at least one pixel height to it will space it so they can't touch. Remember that SDL_ttf doesn't handle multiline printing, so you are responsible for line spacing, see the TTF_FontLineSkip as well.
NOTE: Passing a NULL font into this function will cause a segfault.
Example
// get the loaded font's max height
//TTF_Font *font;
printf("The font max height is: %d\n", TTF_FontHeight(font));
See Also
SdlTtf Class | Tao.Sdl Namespace | TTF_FontAscent | TTF_FontDescent | TTF_FontLineSkip