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 β€” the TTF_Text to 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 -1 for the remainder of the string. so -1 is 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 πŸ‘€


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