TTF_SubString(3type)

TTF_SubString πŸ’…βœ¨ (SDL_ttf3 DATATYPES, bestie)

okay so real talk: this page is TTF_SubString(3type), living in the SDL_ttf3 DATATYPES part of the manual, and it's literally just the glow-up explanation of one struct. it's giving "i know exactly where a lil piece of your text is" and honestly? obsessed. 🫢


✨ NAME ✨

TTF_SubString β€” the representation of a substring within text.

πŸŽ€ HEADER FILE πŸŽ€

it's defined in SDL3_ttf/SDL_ttf.h. yes bestie, that exact path, no cap. πŸ¦‹

🌈 SYNOPSIS 🌈

#include "SDL3_ttf/SDL_ttf.h"

typedef struct TTF_SubString
{
    TTF_SubStringFlags flags;   /**< The flags for this substring */
    int offset;                 /**< The byte offset from the beginning of the text */
    int length;                 /**< The byte length starting at the offset */
    int line_index;             /**< The index of the line that contains this substring */
    int cluster_index;          /**< The internal cluster index, used for quickly iterating */
    SDL_Rect rect;              /**< The rectangle, relative to the top left of the text, containing the substring */
} TTF_SubString;

and here's the vibe check on every single field, because you deserve to know:

  • flags (type TTF_SubStringFlags) β€” the flags for this substring. 🚩
  • offset (type int) β€” the byte offset from the beginning of the text.
  • length (type int) β€” the byte length starting at the offset.
  • line_index (type int) β€” the index of the line that contains this substring.
  • cluster_index (type int) β€” the internal cluster index, used for quickly iterating. lowkey the speedrun field. πŸ”₯
  • rect (type SDL_Rect) β€” the rectangle, relative to the top left of the text, containing the substring.

🌸 AVAILABILITY 🌸

this struct is available since SDL_ttf 3.0.0. periodt. πŸ’œ

πŸ‘‘ SEE ALSO πŸ‘‘

the besties this struct runs with:

β€’(3), TTF_GetNextTextSubString(3), β€’(3),
TTF_GetPreviousTextSubString(3), β€’(3), TTF_GetTextSubString(3), β€’(3),
TTF_GetTextSubStringForLine(3), β€’(3), TTF_GetTextSubStringForPoint(3),
β€’(3), TTF_GetTextSubStringsForRange(3)

and that's the whole page, bestie πŸ’– this was TTF_SubString(3type), brought to you by SDL_ttf 3.2.2 β€” go forth and substring responsibly, ily πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from