TTF_Direction(3type)
πΈ NAME πΈ
TTF_Direction β the direction flags, bestie. It's a lil' enum that tells your text which way to go, and it lives in the SDL_ttf3 DATATYPES squad π
π HEADER FILE π
It's defined in SDL3_ttf/SDL_ttf.h, so that's the file you're gonna wanna have pulled up, no cap.
β¨ SYNOPSIS β¨
#include "SDL3_ttf/SDL_ttf.h"
typedef enum TTF_Direction
{
TTF_DIRECTION_INVALID = 0,
TTF_DIRECTION_LTR = 4, /**< Left to Right */
TTF_DIRECTION_RTL, /**< Right to Left */
TTF_DIRECTION_TTB, /**< Top to Bottom */
TTF_DIRECTION_BTT /**< Bottom to Top */
} TTF_Direction;
π DESCRIPTION π
Okay so here's the tea, bestie: the values in this enum are specifically chosen to match hb_direction_t from HarfBuzz. Like, on purpose. Deliberately. So if you've been hanging out in HarfBuzz land, these numbers are gonna feel extremely familiar and that's the whole point π«Ά
Here's the HarfBuzz reference it's matching, preserved in all its chaotic glory:
hb_direction_t β¨https://
harfbuzz.www:lenstrwww:splitstr:nwww:splitstr:r[char46]github.www:lenstrwww:splitstr:nwww:splitstr:r[char46]io/
harfbuzz-hb-
common.www:lenstrwww:splitstr:nwww:splitstr:r[char46]html#hb-direction-
tβ©
And the values themselves, for the visual learners π:
TTF_DIRECTION_INVALID = 0β not a direction, it's giving "no thanks" π this is your zero, your nothing, your invalid vibe.TTF_DIRECTION_LTR = 4β Left to Right. The classic. The default-flavored one. Very "English essay" of it β¨TTF_DIRECTION_RTLβ Right to Left. It's giving Arabic, Hebrew, absolute icon behavior πΈTTF_DIRECTION_TTBβ Top to Bottom. Vertical. Stacked. Main character energy going downward πTTF_DIRECTION_BTTβ Bottom to Top. Vertical, but make it ascending. Going up, literally π
Heads up bestie:TTF_DIRECTION_LTRis explicitly pinned to4, andTTF_DIRECTION_INVALIDis pinned to0. The other three don't have a value written out, so don't go memorizing numbers β just use the names, fr fr.
π¦ AVAILABILITY π¦
This enum has been serving looks since SDL_ttf 3.0.0. Before that? She simply did not exist. Periodt.
π SEE ALSO π
β’(3)TTF_SetFontDirection(3)
okay that's the whole page, you ate it, go set some font directions π
This page came from SDL_ttf 3.2.2 β mwah, kisses, bye bestie πβ¨
π¦ 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