TTF_Text(3type)

πŸ’– TTF_Text β€” the glow-up datatype πŸ’–

TTF_Text is a manual page from the SDL_ttf3 DATATYPES corner of the SDL_ttf world, and it's giving "text object, but make it a struct." ✨


🌸 NAME 🌸

TTF_Text β€” Text created with TTF_CreateText() 🫢


πŸŽ€ HEADER FILE πŸŽ€

Defined in SDL3_ttf/SDL_ttf.h

Like, that's where she lives. That's her address. 🏠


✨ SYNOPSIS ✨

#include "SDL3_ttf/SDL_ttf.h"

typedef struct TTF_Text
{
    char *text;             /**< A copy of the UTF-8 string that this text object represents, useful for layout, debugging and retrieving substring text. This is updated when the text object is modified and will be freed automatically when the object is destroyed. */
    int num_lines;          /**< The number of lines in the text, 0 if it's empty */

    int refcount;           /**< Application reference count, used when freeing surface */

    TTF_TextData *internal; /**< Private */

} TTF_Text;

Okay bestie, let's break down the squad member by member πŸ’…

  • char *text β€” a whole copy of the UTF-8 string that this text object represents. It's highkey useful for layout, for debugging, and for pulling out substring text. She gets updated whenever the text object is modified, and she gets freed automatically when the object is destroyed. No cap, you don't have to babysit her. 🧚
  • int num_lines β€” how many lines are in the text. It's 0 if the text is empty. Periodt.
  • int refcount β€” the application reference count, used when freeing the surface. πŸ‘‘
  • TTF_TextData *internal β€” Private. That's it, that's the whole description. Not your business, bestie, look away. πŸ™ˆ

🌈 AVAILABILITY 🌈

This struct is available since SDL_ttf 3.0.0. She's been iconic for a minute. πŸ’–


πŸ‘€ SEE ALSO πŸ‘€

The original page drops this list, verbatim:

β€’(3), TTF_CreateText(3), β€’(3), TTF_GetTextProperties(3), β€’(3), TTF_DestroyText(3)

So the actual functions you're gonna wanna go read are:


Real talk: don't go poking at internal. It's marked Private for a reason. Fr fr. 🚫

That's the whole page, bestie β€” written for SDL_ttf 3.2.2, dated SDL_ttf, and sourced straight from the SDL_ttf manual. Go forth and slay your text rendering. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from