24 explicit Font(
const std::string &fontpath);
72 C2D_Font fontData =
nullptr;
109 explicit Text(
const std::string &content);
129 void Draw(
float x,
float y,
float z = 0.0f,
float scaleX = 1.0f,
float scaleY = 1.0f);
146 void DrawWithColor(
float x,
float y,
float z,
float scaleX,
float scaleY, u32 color);
168 void DrawAligned(u32 flags,
float x,
float y,
float z,
float scaleX,
float scaleY);
201 void GetDimensions(
float scaleX,
float scaleY,
float *outWidth,
float *outHeight)
const;
234 C2D_TextBuf staticBuf;
Wrapper class for citro2d font management.
Definition text.hpp:15
Font & operator=(const Font &)=delete
Copy assignment operator (deleted).
Font(const std::string &fontpath)
Constructs a Font object by loading a font from a file.
~Font()
Destructor that automatically frees the font data.
bool IsLoaded() const
Returns true if the font was successfully loaded.
C2D_Font GetHandle() const
Gets the underlying C2D_Font handle.
void Free()
Manually frees the font data before destruction.
Font(const Font &)=delete
Copy constructor (deleted).
Text(const std::string &content, Font *font)
Constructs a Text object with a custom font.
void DrawAligned(u32 flags, float x, float y, float z, float scaleX, float scaleY)
Draws text with custom alignment flags.
void DrawWithColor(float x, float y, float z, float scaleX, float scaleY, u32 color)
Draws text with a specified color and left alignment.
void DrawWithColorAligned(u32 flags, float x, float y, float z, float scaleX, float scaleY, u32 color)
Draws text with color and custom alignment.
Text(const Text &)=delete
Copy constructor (deleted).
Text(const std::string &content)
Constructs a Text object with the system font.
void Draw(float x, float y, float z=0.0f, float scaleX=1.0f, float scaleY=1.0f)
Draws text with basic parameters and left alignment.
~Text()
Destructor that frees the text buffer.
void GetDimensions(float scaleX, float scaleY, float *outWidth, float *outHeight) const
Gets the dimensions of the rendered text.
Text & operator=(const Text &)=delete
Copy assignment operator (deleted).
void SetContent(const std::string &newContent)
Updates the text content and re-parses it.