ObjectivelyMVC
Object oriented MVC framework for SDL3 and GNU C
Loading...
Searching...
No Matches
Text.h File Reference

Text rendered with TrueType fonts. More...

#include <SDL3/SDL_gpu.h>
#include <ObjectivelyMVC/Font.h>
#include <ObjectivelyMVC/View.h>

Go to the source code of this file.

Data Structures

struct  Text
 Text rendered with TrueType fonts. More...
 

Functions

OBJECTIVELYMVC_EXPORT Class * _Text (void)
 

Variables

OBJECTIVELYMVC_EXPORT SDL_Color TextEscapeColors [10]
 Color palette for text escape sequences (^0-^7).
 

Detailed Description

Text rendered with TrueType fonts.

Definition in file Text.h.

Function Documentation

◆ _Text()

OBJECTIVELYMVC_EXPORT Class * _Text ( void  )

Definition at line 602 of file Text.c.

602 {
603 static Class *clazz;
604 static Once once;
605
606 do_once(&once, {
607 clazz = _initialize(&(const ClassDef) {
608 .name = "Text",
609 .superclass = _View(),
610 .instanceSize = sizeof(Text),
611 .interfaceOffset = offsetof(Text, interface),
612 .interfaceSize = sizeof(TextInterface),
614 });
615 });
616
617 return clazz;
618}
static void initialize(Class *clazz)
Definition Text.c:578
Class * _View(void)
Definition View.c:2067
Text rendered with TrueType fonts.
Definition Text.h:69

Variable Documentation

◆ TextEscapeColors

OBJECTIVELYMVC_EXPORT SDL_Color TextEscapeColors[10]

Color palette for text escape sequences (^0-^7).

Defines the colors used when rendering Text with colorEscapes enabled. Embedding applications can customize this array at runtime before rendering.

Default mapping:

  • ^0 = Black
  • ^1 = Red
  • ^2 = Green
  • ^3 = Yellow
  • ^4 = Blue
  • ^5 = Magenta
  • ^6 = Cyan
  • ^7 = White
Warning
Do not modify the array size (must remain exactly 8 elements).
Modifications should be made early in initialization, before rendering text.

Example customization:

TextEscapeColors[8] = (SDL_Color) { 0xFF, 0x80, 0x00, 0xFF }; // ^8 = Orange
SDL_Color TextEscapeColors[]
Definition Text.c:42

Definition at line 60 of file Text.h.