TTF_GetNextTextSubString(3)
π TTF_GetNextTextSubString(3) π
okay bestie, welcome to the SDL_ttf3 FUNCTIONS corner of the manual, where we're talking about TTF_GetNextTextSubString. she's living in SDL3_ttf/SDL_ttf.h, she's defined there, and she is literally here to walk you through a text object one substring at a time. no cap. π¦
β¨ NAME β¨
TTF_GetNextTextSubString β get the next substring in a text object π
π HEADER FILE π
defined in SDL3_ttf/SDL_ttf.h β that's where she lives, that's her address, respect it π
πΈ SYNOPSIS πΈ
#include "SDL3_ttf/SDL_ttf.h"
bool TTF_GetNextTextSubString(TTF_Text *text, const TTF_SubString *substring, TTF_SubString *next);
look at her. so clean. so iconic. β¨
π DESCRIPTION π
so the way this works, bestie: you hand her a text object and a substring, and she goes and gets you the next one. iterator energy. main character behaviour fr fr.
and here's the little plot twist you need to know about: if you call this at the end of the text, she doesn't just give you nothing and walk away β she returns a zero length substring with the TTF_SUBSTRING_TEXT_END flag set. so that's your lil signal that you've hit the end. π she's polite like that.
π«Ά FUNCTION PARAMETERS π«Ά
textβ theTTF_Textyou want to query. this is the text object in question, your girl πsubstringβ theTTF_SubStringyou want to query. the one you're currently sitting on πnextβ a pointer that gets filled in with the next substring. yes she writes into it. that's the whole point π
β RETURN VALUE β
returns true on success, or false on failure. and if it's a fail? don't panic, just call SDL_GetError() for more information. she'll tell you what went wrong, i promise π
π§΅ THREAD SAFETY π§΅
bestie listen. this function should be called on the thread that created the text. that's the rule. don't be out here calling her from some random thread, that's not the vibe π€
π AVAILABILITY π
this function has been available since SDL_ttf 3.0.0. vintage-ish. classic. ate. π₯
π« SEE ALSO π«
okay there's no SEE ALSO section on this one, so instead just go read the rest of the SDL_ttf docs, they're all right there, iykyk π¦
and that's the whole page, bestie!! go iterate over some substrings, you're gonna slay it πβ¨π
this has been your girl from the SDL_ttf manual, page TTF_GetNextTextSubString(3), brought to you by SDL_ttf 3.2.2 β mwah, take care of yourself, hydrate, and don't forget to check for the end flag π«Άπ
π¦ 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