TTF_DeleteTextString(3)
π TTF_DeleteTextString(3) π
okay bestie, so this is a page from the SDL_ttf3 FUNCTIONS section of the manual, and it's all about TTF_DeleteTextString π
β¨ NAME β¨
TTF_DeleteTextString β Delete UTF-8 text from a text object.
π HEADER FILE π
Defined in SDL3_ttf/SDL_ttf.h
π«Ά SYNOPSIS π«Ά
#include "SDL3_ttf/SDL_ttf.h"
bool TTF_DeleteTextString(TTF_Text *text, int offset, int length);
πΈ DESCRIPTION πΈ
This function may cause the internal text representation to be rebuilt.
no cap, it might rebuild the internal text representation. just so you're not surprised, bestie π
π FUNCTION PARAMETERS π
textβ theTTF_Textto modify. that's the main character here πoffsetβ the offset, in bytes, from the beginning of the string if>= 0, and the offset from the end of the string if< 0. β οΈ Heads up: this does not do UTF-8 validation, so you should only delete at UTF-8 sequence boundaries. like literally please respect the boundaries πlengthβ the length of text to delete, in bytes, or-1for the remainder of the string. so-1is the "yeet the rest of it" option π¦
β RETURN VALUE β
Returns true on success or false on failure; call SDL_GetError() for more information.
so if it comes back false, go ask SDL_GetError() what happened, she always knows π
π§΅ THREAD SAFETY π§΅
This function should be called on the thread that created the text.
fr fr β same thread that made the text, or don't bother β
π AVAILABILITY π
This function is available since SDL_ttf 3.0.0.
π SEE ALSO π
β’(3)TTF_AppendTextString(3)β’(3)TTF_InsertTextString(3)β’(3)TTF_SetTextString(3)
that's the whole vibe, bestie π go delete some text (respectfully, at UTF-8 sequence boundaries) β¨ππ¦
SDL_ttf 3.2.2 β mwah, tysm for reading, ilysm π«Άπ πΈ
π¦ 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