engine::graphics::Font class

Represents a loaded font resource.

Public static functions

static auto Load(const std::string& path) -> std::shared_ptr<Font>
Loads a font from disk.

Constructors, destructors, conversion operators

~Font()
Destructor cleans up OpenGL resources.

Public functions

auto characters() const -> const std::map<char, Character>&
Gets the character map for this font.

Function documentation

static std::shared_ptr<Font> engine::graphics::Font::Load(const std::string& path)

Loads a font from disk.

Parameters
path The path (and optional size) of the font.
Returns A shared pointer to the Font, or nullptr if loading fails.

Expected format for path: "filename.ttf" or "filename.ttf:size". If size is not provided, a default (e.g., 16) is used.

const std::map<char, Character>& engine::graphics::Font::characters() const

Gets the character map for this font.

Returns Reference to the character map.