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