Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
Olympe::FontManager Class Reference

Singleton manager for custom fonts. More...

#include <FontManager.h>

Public Member Functions

void Initialize ()
 Initialize font system Must be called after ImGui context creation but before first frame.
 
bool LoadFontAwesome (const std::string &fontPath, float fontSize=16.0f)
 Load Font Awesome font.
 
ImFontLoadFont (const std::string &fontPath, float fontSize, const std::string &fontName="")
 Load a custom font.
 
ImFontGetFontAwesome () const
 Get Font Awesome font.
 
ImFontGetDefaultFont () const
 Get default font.
 
bool IsFontAwesomeLoaded () const
 Check if Font Awesome is loaded.
 

Static Public Member Functions

static FontManagerGet ()
 Get singleton instance.
 

Private Member Functions

 FontManager ()
 
 ~FontManager ()=default
 
 FontManager (const FontManager &)=delete
 
FontManageroperator= (const FontManager &)=delete
 

Private Attributes

ImFontm_FontAwesome
 
ImFontm_DefaultFont
 
bool m_Initialized
 

Detailed Description

Singleton manager for custom fonts.

Definition at line 24 of file FontManager.h.

Constructor & Destructor Documentation

◆ FontManager() [1/2]

Olympe::FontManager::FontManager ( )
inlineprivate

Definition at line 72 of file FontManager.h.

◆ ~FontManager()

Olympe::FontManager::~FontManager ( )
privatedefault

◆ FontManager() [2/2]

Olympe::FontManager::FontManager ( const FontManager )
privatedelete

Member Function Documentation

◆ Get()

FontManager & Olympe::FontManager::Get ( )
static

Get singleton instance.

Definition at line 16 of file FontManager.cpp.

References GetComponentTypeID_Static().

Referenced by Olympe::BlueprintEditorGUI::Initialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDefaultFont()

ImFont * Olympe::FontManager::GetDefaultFont ( ) const
inline

Get default font.

Returns
Pointer to default ImGui font

Definition at line 64 of file FontManager.h.

References m_DefaultFont.

◆ GetFontAwesome()

ImFont * Olympe::FontManager::GetFontAwesome ( ) const
inline

Get Font Awesome font.

Returns
Pointer to Font Awesome font, nullptr if not loaded

Definition at line 58 of file FontManager.h.

References m_FontAwesome.

◆ Initialize()

void Olympe::FontManager::Initialize ( )

Initialize font system Must be called after ImGui context creation but before first frame.

Definition at line 22 of file FontManager.cpp.

References m_DefaultFont, m_Initialized, and SYSTEM_LOG.

Referenced by Olympe::BlueprintEditorGUI::Initialize().

+ Here is the caller graph for this function:

◆ IsFontAwesomeLoaded()

bool Olympe::FontManager::IsFontAwesomeLoaded ( ) const
inline

Check if Font Awesome is loaded.

Definition at line 69 of file FontManager.h.

References m_FontAwesome.

◆ LoadFont()

ImFont * Olympe::FontManager::LoadFont ( const std::string &  fontPath,
float  fontSize,
const std::string &  fontName = "" 
)

Load a custom font.

Parameters
fontPathPath to font file
fontSizeFont size
fontNameOptional name identifier
Returns
Pointer to loaded font, nullptr on failure

Definition at line 83 of file FontManager.cpp.

References GetComponentTypeID_Static(), m_Initialized, and SYSTEM_LOG.

+ Here is the call graph for this function:

◆ LoadFontAwesome()

bool Olympe::FontManager::LoadFontAwesome ( const std::string &  fontPath,
float  fontSize = 16.0f 
)

Load Font Awesome font.

Parameters
fontPathPath to Font Awesome .otf file
fontSizeBase font size (default: 16.0f)
Returns
true if loaded successfully

Definition at line 35 of file FontManager.cpp.

References FONT_ICON_RANGE_FA_MAX, FONT_ICON_RANGE_FA_MIN, GetComponentTypeID_Static(), m_FontAwesome, m_Initialized, and SYSTEM_LOG.

Referenced by Olympe::BlueprintEditorGUI::Initialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=()

FontManager & Olympe::FontManager::operator= ( const FontManager )
privatedelete

Member Data Documentation

◆ m_DefaultFont

ImFont* Olympe::FontManager::m_DefaultFont
private

Definition at line 78 of file FontManager.h.

Referenced by GetDefaultFont(), and Initialize().

◆ m_FontAwesome

ImFont* Olympe::FontManager::m_FontAwesome
private

Definition at line 77 of file FontManager.h.

Referenced by GetFontAwesome(), IsFontAwesomeLoaded(), and LoadFontAwesome().

◆ m_Initialized

bool Olympe::FontManager::m_Initialized
private

Definition at line 79 of file FontManager.h.

Referenced by Initialize(), LoadFont(), and LoadFontAwesome().


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