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_LTR is explicitly pinned to 4, and TTF_DIRECTION_INVALID is pinned to 0. 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 🌟


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