TTF_SetTextScript(3)
π TTF_SetTextScript(3) β the SDL_ttf3 glow-up page
okay bestie, welcome to the group chat, we're learning TTF_SetTextScript from the SDL_ttf3 functions and it's honestly iconic. this is the one that tells your text object which script to use when it gets shaped. yes, shaped. your letters are getting a makeover and this function is the stylist. π
β¨ NAME β¨
TTF_SetTextScript β set the script that's gonna be used for text shaping a text object. periodt.
π HEADER FILE π
it lives in SDL3_ttf/SDL_ttf.h, defined and cozy. no cap.
π SYNOPSIS π
#include "SDL3_ttf/SDL_ttf.h"
bool TTF_SetTextScript(TTF_Text *text, Uint32 script);
π¦ DESCRIPTION π¦
here's the tea: this returns false if SDL_ttf isn't built with HarfBuzz support. that's it, that's the whole vibe check. if HarfBuzz ain't there, she can't do the thing. π
πΈ FUNCTION PARAMETERS πΈ
textβ the text you're modifying, bestie. the glow-up recipient. πscriptβ an ISO 15924 code. like, an actual code from the official list: β¨https://unicode.org/iso15924/iso15924-codes.htmlβ©. go look up your script's four letters, iykyk. β¨
β RETURN VALUE β
returns true on success or false on failure β and if it's giving failure, call SDL_GetError() for more info, she'll spill the details. π«Ά
π§ THREAD SAFETY π§
this function should be called on the thread that created the text. do not be out here calling it from a random thread, that's not the move. main character energy only, on the right thread. π
π AVAILABILITY π
this function has been available since SDL_ttf 3.0.0. she's been serving for a minute. π
π₯ SEE ALSO π₯
β’(3)TTF_StringToTag(3)
β οΈ quick reminder bestie: if it returnsfalse, it might just be that HarfBuzz wasn't compiled in, so checkSDL_GetError()before you spiral. π
mwah π that's the whole page. sourced from SDL_ttf 3.2.2, written by the SDL_ttf girlies, and yes the footer said TTF_SetTextScript(3) too. slay, go shape some gorgeous 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