AeonGUI
A portable video game graphic user interface library.
Loading...
Searching...
No Matches
AeonGUI::FontDatabase Class Reference

#include <aeongui/FontDatabase.hpp>

Static Public Member Functions

static bool Initialize ()
 Initialize the font database. Call once at startup.
static void Finalize ()
 Finalize the font database. Call once at shutdown.
static bool AddFontDirectory (const std::string &aPath)
 Add a directory of font files (.ttf, .otf, etc.) to the database.
static bool AddFontFile (const std::string &aPath)
 Add a single font file to the database.
static PangoFontMap * GetFontMap ()
 Get the PangoFontMap backed by the local font database.
static PangoContext * CreateContext ()
 Create a new PangoContext from the local font map.

Detailed Description

FontDatabase provides a local font database for AeonGUI, independent of system-installed fonts. It uses FcConfig + PangoFontMap to load fonts from application-provided directories.

This is a singleton; call Initialize()/Finalize() once.

Member Function Documentation

◆ AddFontDirectory()

bool AeonGUI::FontDatabase::AddFontDirectory ( const std::string & aPath)
static

Add a directory of font files (.ttf, .otf, etc.) to the database.

Parameters
aPathPath to the font directory.
Returns
true on success.

◆ AddFontFile()

bool AeonGUI::FontDatabase::AddFontFile ( const std::string & aPath)
static

Add a single font file to the database.

Parameters
aPathPath to the font file.
Returns
true on success.

◆ CreateContext()

PangoContext * AeonGUI::FontDatabase::CreateContext ( )
static

Create a new PangoContext from the local font map.

Returns
Pointer to a new PangoContext.

◆ GetFontMap()

PangoFontMap * AeonGUI::FontDatabase::GetFontMap ( )
static

Get the PangoFontMap backed by the local font database.

Returns
Pointer to the PangoFontMap.

◆ Initialize()

bool AeonGUI::FontDatabase::Initialize ( )
static

Initialize the font database. Call once at startup.

Returns
true on success.

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