Font Manager - Horizon-NTH/HorizonGUI GitHub Wiki

FontManager

Overview

The FontManager class, located in the hgui namespace, offers a flexible approach for managing Fonts in your graphical application. The class can be found inside the header file FontManager.h.

Member Functions

  • std::shared_ptr<kernel::Font> create(const std::string& fontPath): Creates a new font by specifying the file path.

Example Usage

#include <hgui/header/FontManager.h>

{ // Example Usage of FontManager
    std::string fontPath = "path/to/your/font.ttf";

    // Create a font
    std::shared_ptr<hgui::kernel::Font> customFont = hgui::FontManager::create(fontPath);

    // Use the font as needed
    // (Render text using the custom font here)
} // Here the custom font is destroyed

Note: In the "Example Usage" section, we demonstrate how to create a custom font with the FontManager class.