TTF_GetTextScript(3)
β¨ TTF_GetTextScript β¨
okay bestie, so this is TTF_GetTextScript(3) from the SDL_ttf3 function family, and it's literally the little detective that tells you which script your text object is getting shaped with π
πΈ NAME πΈ
TTF_GetTextScript β get the script used for text shaping a text object π¦
π HEADER FILE π
it lives in SDL3_ttf/SDL_ttf.h, no cap π
β¨ SYNOPSIS β¨
#include "SDL3_ttf/SDL_ttf.h"
Uint32 TTF_GetTextScript(TTF_Text *text);
π DESCRIPTION π
so likeβ¦ this one just asks your text object "hey girl, what script are you?" π«Ά
If nobody set one explicitly, it defaults to the script of the font used by the text object. so it's giving "inherited from the font" energy β¨
π FUNCTION PARAMETERS π
textβ the text to query π (that's the one you're asking about, bestie)
π RETURN VALUE π
Returns an ISO 15924 code β
like, from this list:
https://
unicode.www:lenstrwww:splitstr:nwww:splitstr:r[char46]org/iso15924/
iso15924-codes.www:lenstrwww:splitstr:nwww:splitstr:r[char46]html
not me side-eyeing the man page renderer for chewing up that URL π that's literally what it says in the source page though, so I'm keeping it exactly as-is. iykyk.
OR it returns 0 if a script hasn't been set on either the text object or the font π (no script anywhere = sad little zero)
π§ THREAD SAFETY π§
this function should be called on the thread that created the text. periodt. π₯ don't be out here calling it from some random thread, that's not the vibe π
π AVAILABILITY π
this function is available since SDL_ttf 3.0.0 β so it's been iconic for a while now β¨
π SEE ALSO π
β’(3)TTF_TagToString(3)
and that's the whole thing, bestie! π this page is from SDL_ttf version 3.2.2 (the SDL_ttf 3.2.2 footer energy), and yeah the title line is just TTF_GetTextScript(3) again because man pages love repeating themselves π
go forth and query your scripts, you main character π¦π
π¦ 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