CheatMenuSA/src/fontmgr.h

32 lines
642 B
C
Raw Normal View History

2021-11-05 05:59:11 -04:00
#pragma once
2021-12-24 05:36:07 -05:00
/*
Font Manager class
Handles loading, fetching, freeing & reloading fonts
*/
2021-11-05 05:59:11 -04:00
class FontMgr
{
private:
struct FontInfo
{
ImFont *m_pFont;
2021-12-24 05:36:07 -05:00
size_t m_nSize;
float m_fMul;
2021-11-05 05:59:11 -04:00
std::string m_path;
};
2021-12-24 05:36:07 -05:00
static inline std::vector<FontInfo> m_vecFonts;
2021-11-05 05:59:11 -04:00
public:
FontMgr() = delete;
FontMgr(FontMgr&) = delete;
static ImFont* GetFont(const char* fontName);
static ImFont* LoadFont(const char* fontName, float fontMul = 1.0f);
2022-01-07 03:18:00 -05:00
2021-12-24 05:36:07 -05:00
// ImGui::GetIO().Default font must be loaded after unloading all fonts
static void UnloadFonts();
static void ReloadFonts();
2021-11-05 05:59:11 -04:00
};