TTF_GetFontDescent(3)

πŸ’– TTF_GetFontDescent(3) πŸ’–

okay bestie, welcome to the SDL_ttf3 FUNCTIONS corner of the manual, where we're talking about TTF_GetFontDescent β€” the lil function that tells you how far down a font dips from the baseline. yes it's negative. yes that's on purpose. let's get into it πŸ¦‹


🌸 NAME 🌸

TTF_GetFontDescent β€” query the offset from the baseline to the bottom of a font.

like, the bottom-bottom. the underhang. the lil bit that hangs below the line ✨


πŸŽ€ HEADER FILE πŸŽ€

defined in SDL3_ttf/SDL_ttf.h


✨ SYNOPSIS ✨

#include "SDL3_ttf/SDL_ttf.h"

int TTF_GetFontDescent(const TTF_Font *font);

πŸ’… DESCRIPTION πŸ’…

so here's the tea: this is a negative value, relative to the baseline. that's the whole vibe. it's not a bug, it's not a glitch, it's just how descent math works β€” down is negative, periodt πŸ‘‘


🫢 FUNCTION PARAMETERS 🫢

  • font β€” the font to query. (the one you're being nosy about πŸ’œ)

⭐ RETURN VALUE ⭐

returns the font's descent. that's it, that's the answer, no cap 🌈


🧚 THREAD SAFETY 🧚

it is safe to call this function from any thread. go wild, queen β€” multithreaded font interrogation is fully on the table πŸ”₯


πŸ‘‘ AVAILABILITY πŸ‘‘

this function is available since SDL_ttf 3.0.0. so if you're on anything older... bestie, upgrade 😭


mwah πŸ’‹ that's the whole page. go measure your fonts, you icon.

source: SDL_ttf, version 3.2.2 β€” from the SDL_ttf manual, and yeah, this whole thing is TTF_GetFontDescent(3) πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from