TTF_SETTEXTWRAPWHITESPACEVISIBLE(3)
π TTF_SetTextWrapWhitespaceVisible(3) π
okay bestie, listen β this one lives in the SDL_ttf3 function fam, and it's all about whether your whitespace gets to ~exist visibly~ when a text object wraps. yes, we're doing typography therapy today. π
β¨ NAME β¨
TTF_SetTextWrapWhitespaceVisible β set whether whitespace should be visible when wrapping a text object.
π HEADER FILE π
Defined in SDL3_ttf/SDL_ttf.h β that's the one, no cap.
πΈ SYNOPSIS πΈ
#include "SDL3_ttf/SDL_ttf.h"
bool TTF_SetTextWrapWhitespaceVisible(TTF_Text *text, bool visible);
π¦ DESCRIPTION π¦
so here's the tea. If the whitespace is visible, it will take up space for purposes of alignment and wrapping. periodt. That's genuinely good for editing β like when you're in there messing with text and you wanna see what's going on.
But lowkey? It looks better when centered or aligned if the whitespace around line wrapping is hidden. aesthetic matters. π
This defaults to false. (so by default, hidden. shy whitespace. we love that for it.)
β οΈ heads up: this function may cause the internal text representation to be rebuilt. so like, it's doing actual work back there, not just vibes.
π«Ά FUNCTION PARAMETERS π«Ά
textβ theTTF_Textto modify. (the main character, obviously π)visibleβtrueto show whitespace when wrapping text,falseto hide it. pick your fighter. β¨
β RETURN VALUE β
Returns true on success or false on failure. and if it fails?? call SDL_GetError() for more information β it'll tell you what went wrong, fr fr. π
π§΅ THREAD SAFETY π§΅
This function should be called on the thread that created the text. no thread-hopping, bestie. stay loyal to your origin thread. π
π AVAILABILITY π
This function is available since SDL_ttf 3.0.0. vintage-ish but not ancient. iconic behavior. β¨
π SEE ALSO π
(yes, go read the sibling function, they're a matching set π)
mwah π that's the whole page, and it's brought to you by SDL_ttf 3.2.2 β shoutout to the SDL_ttf girlies keeping text rendering cute since forever. go forth and wrap your whitespace however your heart desires, 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