citro2d
Data Structures | Typedefs | Enumerations | Functions
text.h File Reference

Text rendering API. More...

#include "base.h"
#include "font.h"

Go to the source code of this file.

Data Structures

struct  C2D_Text
 Text object. More...
 

Typedefs

typedef struct C2D_TextBuf_s * C2D_TextBuf
 

Enumerations

enum  {
  C2D_AtBaseline = BIT(0),
  C2D_WithColor = BIT(1)
}
 

Functions

C2D_TextBuf C2D_TextBufNew (size_t maxGlyphs)
 Creates a new text buffer. More...
 
C2D_TextBuf C2D_TextBufResize (C2D_TextBuf buf, size_t maxGlyphs)
 Resizes a text buffer. More...
 
void C2D_TextBufDelete (C2D_TextBuf buf)
 Deletes a text buffer. More...
 
void C2D_TextBufClear (C2D_TextBuf buf)
 Clears all stored text in a buffer. More...
 
size_t C2D_TextBufGetNumGlyphs (C2D_TextBuf buf)
 Retrieves the number of glyphs stored in a text buffer. More...
 
const char * C2D_TextParseLine (C2D_Text *text, C2D_TextBuf buf, const char *str, u32 lineNo)
 Parses and adds a single line of text to a text buffer. More...
 
const char * C2D_TextFontParseLine (C2D_Text *text, C2D_Font font, C2D_TextBuf buf, const char *str, u32 lineNo)
 Parses and adds a single line of text to a text buffer. More...
 
const char * C2D_TextParse (C2D_Text *text, C2D_TextBuf buf, const char *str)
 Parses and adds arbitrary text (including newlines) to a text buffer. More...
 
const char * C2D_TextFontParse (C2D_Text *text, C2D_Font font, C2D_TextBuf buf, const char *str)
 Parses and adds arbitrary text (including newlines) to a text buffer. More...
 
void C2D_TextOptimize (const C2D_Text *text)
 Optimizes a text object in order to be drawn more efficiently. More...
 
void C2D_TextGetDimensions (const C2D_Text *text, float scaleX, float scaleY, float *outWidth, float *outHeight)
 Retrieves the total dimensions of a text object. More...
 
void C2D_DrawText (const C2D_Text *text, u32 flags, float x, float y, float z, float scaleX, float scaleY,...)
 Draws text using the GPU. More...
 

Detailed Description

Text rendering API.