TTF_GetText...ingsForRange(3)
π TTF_GetTextSubStringsForRange(3) π
okay bestie, welcome to the SDL_ttf3 FUNCTIONS section of the manual, and lemme tell you, this one is a lil baddie. It's literally the function that gets you the substrings of a text object that contain a range of text. That's it, that's the vibe. π¦
πΈ NAME πΈ
TTF_GetTextSubStringsForRange β get the substrings of a text object that contain a range of text. no cap, that's the whole job description. β¨
π HEADER FILE π
It's defined in SDL3_ttf/SDL_ttf.h, bestie. go get it. π
β¨ SYNOPSIS β¨
#include "SDL3_ttf/SDL_ttf.h"
TTF_SubString ** TTF_GetTextSubStringsForRange(TTF_Text *text, int offset, int length, int *count);
look at her. so clean. so iconic. π
π FUNCTION PARAMETERS π
textβ theTTF_Textto query. this is the text object you're asking about, she's the main character here.offsetβ a byte offset into the text string. like, where do you wanna start looking, bestie?lengthβ the length of the range being queried, in bytes, or-1for the remainder of the string. so if you're feeling lazy (real),-1means "yeah just gimme everything from there to the end". periodt.countβ a pointer that gets filled in with the number of substrings returned. it may beNULL, so if you don't care, you can just vibe and passNULL. π
π RETURN VALUE π
( TTF_SubString ) It returns a NULL terminated array of substring pointers, or NULL on failure. π and if it fails? call SDL_GetError() for more information, she'll tell you what went wrong.
β οΈ heads up bestie: this is a single allocation that should be freed with SDL_free() when it is no longer needed. do NOT forget, we do not leak memory in this house. π
π§ THREAD SAFETY π§
This function should be called on the thread that created the text. no jumping threads, she's loyal like that. π«Ά
π AVAILABILITY π
This function is available since SDL_ttf 3.0.0. she's been around, she's got history. β
π SIGN-OFF π
and that's the whole page, bestie!! this came to you from SDL_ttf 3.2.2 (the SDL_ttf manual), and honestly? slay. go forth and get those substrings. ππβ¨π₯π
πΈ
π¦ 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