Blamite Game Engine - blam!  00296.01.12.21.0102.blamite
The core library for the Blamite Game Engine.
Blam::Content::Fonts Namespace Reference

Classes

struct  Font
 Structure to contain data for a Font. More...
 
struct  FontGlyph
 Structure to contain data for a Font Glyph. More...
 

Functions

BLAM void LoadAllFonts ()
 Loads all fonts available in the engine's configured font directory. More...
 
BLAM HRESULT LoadFont (std::string path)
 Load a font from disk. More...
 
BLAM HRESULT ReloadFont (std::string id)
 Reloads all data for the specified font. More...
 
BLAM FontGetFont (std::string id)
 Retrieves a font from the list of loaded fonts. More...
 
BLAM FontGlyphGetFontGlyph (Font *font, char glyph)
 Retrieves a glyph from a font. More...
 
BLAM bool FontExists (std::string id)
 Checks whether or not a font is loaded. More...
 
BLAM std::map< std::string, Font > * GetFontList ()
 Retrieves the list of loaded fonts. More...
 
BLAM void Cleanup ()
 Clean-up all font data and free any allocated memory for font data. More...
 

Function Documentation

◆ Cleanup()

void Blam::Content::Fonts::Cleanup ( )

Clean-up all font data and free any allocated memory for font data.

◆ FontExists()

bool Blam::Content::Fonts::FontExists ( std::string  id)

Checks whether or not a font is loaded.

Parameters
id- The ID of the font to check for
Returns
true if the font is loaded, false if it couldn't be found

◆ GetFont()

Font * Blam::Content::Fonts::GetFont ( std::string  id)

Retrieves a font from the list of loaded fonts.

Parameters
id- The ID of the desired font
Returns
A pointer to the font data, or nullptr if the font couldn't be found

◆ GetFontGlyph()

FontGlyph * Blam::Content::Fonts::GetFontGlyph ( Font font,
char  glyph 
)

Retrieves a glyph from a font.

Parameters
font- Pointer to the font to locate a glyph within
glyph- The character to get glyph data for
Returns
A pointer to the font glyph data, or nullptr if the glyph couldn't be found

◆ GetFontList()

std::map< std::string, Font > * Blam::Content::Fonts::GetFontList ( )

Retrieves the list of loaded fonts.

◆ LoadAllFonts()

void Blam::Content::Fonts::LoadAllFonts ( )

Loads all fonts available in the engine's configured font directory.

Todo:
Make it so that the engine can iterate over all fonts in the font directory

◆ LoadFont()

HRESULT Blam::Content::Fonts::LoadFont ( std::string  path)

Load a font from disk.

Do NOT include full path to fontinfo.xml or the .bin extension - this is determined automatically.

Parameters
path- The path of the font, excluding any .bin or /fontinfo.xml suffixes.
Returns
S_OK if the font was loaded successfully. Otherwise, one of the following codes will be returned:

◆ ReloadFont()

HRESULT Blam::Content::Fonts::ReloadFont ( std::string  id)

Reloads all data for the specified font.

Parameters
id- The ID of the font to reload.
Returns
S_OK if no errors occurred, or if the font ID was not found. Anything else should be treated as an error. For details on other return codes, see Blam::Content::Fonts::LoadFont