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 β€” the TTF_Text to modify. (the main character, obviously πŸ‘‘)
  • visible β€” true to show whitespace when wrapping text, false to 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