TTF_SetFontDirection(3)
π TTF_SetFontDirection(3) π
okay bestie, welcome to the SDL_ttf3 function club, today's guest of honour is TTF_SetFontDirection β she sets the direction that a font uses for text shaping. yes, like, which way the words go. iconic behaviour fr fr. π¦
β¨ NAME β¨
TTF_SetFontDirection β set the direction to be used for text shaping by a font.
πΈ HEADER FILE πΈ
she lives in SDL3_ttf/SDL_ttf.h, defined in SDL3_ttf/SDL_ttf.h. that's her address, don't lose it. π
β SYNOPSIS β
#include "SDL3_ttf/SDL_ttf.h"
bool TTF_SetFontDirection(TTF_Font *font, TTF_Direction direction);
look at her. short. sweet. takes two things and returns a bool. main character energy honestly. π
π DESCRIPTION π
so here's the tea: this function only supports left-to-right text shaping if SDL_ttf was not built with HarfBuzz support. like, no HarfBuzz in your build? then LTR is all you're getting, that's the whole menu. no cap. π«Ά
also β and this is the important bit β calling this updates any TTF_Text objects using this font. not just new ones. the existing ones. she goes back and updates her exes. π
π§ FUNCTION PARAMETERS π§
fontβ the font to modify. yes queen, this is the one you're changing.directionβ the new direction for text to flow. the vibe check for which way the words travel.
π₯ RETURN VALUE π₯
returns true on success or false on failure β and if it fails, bestie, go call SDL_GetError() for more info. she will tell you what went wrong, just ask her. π
π THREAD SAFETY π
please please please call this on the thread that created the font. that's the rule. respect the origin thread, she's the only one who can touch this font safely. π
β AVAILABILITY β
this function has been available since SDL_ttf 3.0.0. so she's been around, she's established, she's not new here. π
and that's the whole page, bestie!! this was TTF_SetFontDirection(3) from the SDL_ttf 3.2.2 manual β tysm for reading, mwah πβ¨π go set some directions, you're gonna slay
π¦ 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