Font manager for caching loaded fonts.
More...
#include <font.hpp>
|
| std::shared_ptr< Font > | load (const std::string &name, const std::string &filepath, unsigned int font_size=48) |
| | Load a font or get it from cache.
|
| std::shared_ptr< Font > | get_font (const std::string &name) |
| | Get a previously loaded font.
|
| bool | exists (const std::string &name) const |
| | Check if a font exists in the cache.
|
|
void | clear () |
| | Clear all cached fonts.
|
|
| static FontManager & | get () |
| | Get the singleton instance.
|
Font manager for caching loaded fonts.
Singleton class that manages font loading and caching.
◆ exists()
| bool lmgl::ui::FontManager::exists |
( |
const std::string & | name | ) |
const |
Check if a font exists in the cache.
- Parameters
-
- Returns
- True if font exists, false otherwise.
◆ get()
| FontManager & lmgl::ui::FontManager::get |
( |
| ) |
|
|
static |
Get the singleton instance.
- Returns
- Reference to the FontManager instance.
◆ get_font()
| std::shared_ptr< Font > lmgl::ui::FontManager::get_font |
( |
const std::string & | name | ) |
|
Get a previously loaded font.
- Parameters
-
- Returns
- Shared pointer to the font, or nullptr if not found.
◆ load()
| std::shared_ptr< Font > lmgl::ui::FontManager::load |
( |
const std::string & | name, |
|
|
const std::string & | filepath, |
|
|
unsigned int | font_size = 48 ) |
Load a font or get it from cache.
- Parameters
-
| name | Unique name for the font. |
| filepath | Path to the font file. |
| font_size | Font size in pixels. |
- Returns
- Shared pointer to the loaded font.
The documentation for this class was generated from the following files: