Untitled Game engine no.5  1.0
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Engine::Font Struct Reference

Data structure for storing font texture data. Doubles as a library for loading fonts into memory. More...

#include <Font.hpp>

Public Member Functions

 Font (const char *path)
 Load a font object from a system path.
 
void renderText (const std::string &text, Ref< MeshRenderer > &meshRenderer, Allignment alignment=CENTER, float z=0)
 Renders texture data from a string and applies it to a MeshRenderer. More...
 
void renderText (const std::string &text, MeshRenderer *meshRenderer, Allignment alignment=CENTER, float z=0)
 

Static Public Member Functions

static void InitFont ()
 Initialize global font data.
 
static void FinalizeFonts ()
 Delete any font loader data, not font texture data.
 

Public Attributes

std::vector< Ref< Glyph > > glyphs
 lookup table from a ascii character code to graphical data
 
bool singleTex = true
 is there one texture for all of the characters?
 

Static Public Attributes

static uint GLYPH_COUNT = 256
 Number of required glyphs.
 
static FT_Library FT = nullptr
 link to the Freetype font library
 

Detailed Description

Data structure for storing font texture data. Doubles as a library for loading fonts into memory.

Member Function Documentation

◆ renderText()

void Engine::Font::renderText ( const std::string &  text,
Ref< MeshRenderer > &  meshRenderer,
Allignment  alignment = CENTER,
float  z = 0 
)

Renders texture data from a string and applies it to a MeshRenderer.

Parameters
texttext to render
meshRendererrenderer reference
alignmentText alignment (experimental)
zz layer for the text (helpful for rendering text on top of other UI elements at z layer 0)

The documentation for this struct was generated from the following files: