TTF_GetTextDirection(3)

πŸ’– TTF_GetTextDirection(3) πŸ’–

okay bestie, welcome to the SDL_ttf3 FUNCTIONS corner of the manual, this one lives in the SDL_ttf family and it's genuinely so chill ✨


🌸 NAME 🌸

TTF_GetTextDirection β€” get the direction that's gonna be used for text shaping a text object πŸ¦‹


πŸŽ€ HEADER FILE πŸŽ€

Defined in SDL3_ttf/SDL_ttf.h, no cap. That's the file you're gonna #include, periodt.


✨ SYNOPSIS ✨

#include "SDL3_ttf/SDL_ttf.h"

TTF_Direction TTF_GetTextDirection(TTF_Text *text);

look at that. one function. one parameter. she's simple, she's elegant, she ate πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

This defaults to the direction of the font used by the text object. that's it, that's the whole vibe β€” if nobody's told the text object otherwise, it just inherits whatever direction its font is giving 🌈


🫢 FUNCTION PARAMETERS 🫢

  • text β€” the text to query. like, the text object you're curious about. hand her over and she'll tell you things πŸ‘‘

⭐ RETURN VALUE ⭐

( TTF_Direction ) β€” returns the direction to be used for text shaping. so you get a TTF_Direction back, and that's your answer, fr fr ✨


🧚 THREAD SAFETY 🧚

This function should be called on the thread that created the text. 🚨

not me stressing this β€” do NOT go calling it from some random other thread, bestie. the thread that made the text is the thread that gets to ask about it. that's the rule 😭


πŸ‘‘ AVAILABILITY πŸ‘‘

This function is available since SDL_ttf 3.0.0. so she's been here a minute, iconic behavior 🌟


and that's the whole page, you understood it, you're doing amazing, mwah πŸ’–

signing off from the SDL_ttf 3.2.2 release of the SDL_ttf manual, love u, go shape some text πŸŽ€πŸ¦‹πŸ’…

πŸ“¦ where this page comes from