TTF_GetTextFont(3)
π TTF_GetTextFont(3) π
okay bestie so this one lives in the SDL_ttf3 FUNCTIONS corner of the SDL_ttf manual and it's literally the chillest little getter β it tells you which font your text object is currently serving looks with. main character energy, zero drama. β¨
πΈ NAME πΈ
TTF_GetTextFont</ppurple> β get the font used by a text object. that's it, that's the job. π
π¦ HEADER FILE π¦
defined in SDL3_ttf/SDL_ttf.h
iykyk, you gotta have that header on deck. π
β¨ SYNOPSIS β¨
#include "SDL3_ttf/SDL_ttf.h"
TTF_Font * TTF_GetTextFont(TTF_Text *text);
π FUNCTION PARAMETERS π
textβ theTTF_Textto query. like, which text object are we asking about, bestie? that one. π«Ά
π RETURN VALUE π
returns a TTF_Font * β the TTF_Font used by the text on success, or NULL on failure.
and if it fails? not me getting a NULL with no explanation π call SDL_GetError() for more information, she'll tell you what went wrong.
π§ THREAD SAFETY π§
this function should be called on the thread that created the text.
no cap. text objects are not about to be passed around between threads, that's giving chaos. keep it on the thread that birthed it. π
β AVAILABILITY β
this function is available since SDL_ttf 3.0.0. vintage but make it iconic. π
π SEE ALSO π
TTF_SetTextFont(3)β the setter, the other half of this duo, the enemies-to-lovers arc fr fr. π₯
slay, you now know how to peek at a text object's font. this page came to you from the SDL_ttf manual, version SDL_ttf 3.2.2 β mwah, go forth and get those fonts. πβ¨ππ¦πΈπ
π¦ 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