TTF_GetFontAscent(3)
β¨ TTF_GetFontAscent β¨
okay bestie, so this one lives in the SDL_ttf3 FUNCTIONS part of the manual, page TTF_GetFontAscent(3). it's short, it's sweet, it's lowkey essential. let's get into it π
π NAME π
TTF_GetFontAscent β ask a font how far it stretches from the baseline up to the top. like, the height above the line, fr fr.
π HEADER FILE π
it's defined in SDL3_ttf/SDL_ttf.h β that's the one, don't go looking anywhere else π«Ά
πΈ SYNOPSIS πΈ
#include "SDL3_ttf/SDL_ttf.h"
int TTF_GetFontAscent(const TTF_Font *font);
π DESCRIPTION π
this is a positive value, and it's measured relative to the baseline. that's the whole vibe. ascent = up from the baseline. iconic behaviour honestly π
π¦ FUNCTION PARAMETERS π¦
fontβ the font you wanna query. that's it, that's the whole parameter list, she's simple like that β¨
β RETURN VALUE β
returns the font's ascent. boom. that's the number you asked for π
π§ THREAD SAFETY π§
you can call this from any thread. no cap. go wild, she's thread-safe π
πΈ AVAILABILITY πΈ
this function has been available since SDL_ttf 3.0.0 β so if you're on anything newer, you're chilling π
lowkey a tiny page but highkey useful β never sleep on your font metrics, bestie π
and that's the whole thing! this page comes to you from the SDL_ttf 3.2.2 release, living under the SDL_ttf manual. stay slay, measure your baselines, and go make some beautiful text πππ¦β¨
π¦ where this page comes from
- debian trixie: libsdl3-ttf-doc 3.2.2+ds-1 Β· Zlib
- fedora 43: SDL3_ttf-devel 3.2.2-2.fc43 Β· Zlib AND MIT
- fedora 43: SDL3_ttf-devel 3.2.2-2.fc43 Β· Zlib AND MIT
- fedora 44: SDL3_ttf-devel 3.2.2-4.fc44 Β· Zlib AND MIT
- fedora 44: SDL3_ttf-devel 3.2.2-4.fc44 Β· Zlib AND MIT
- ubuntu questing: libsdl3-ttf-doc 3.2.2+ds-1
- ubuntu resolute: libsdl3-ttf-doc 3.2.2+ds-1build1 Β· Zlib
- ubuntu stonking: libsdl3-ttf-doc 3.2.2+ds-2 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms