#pragma once #include #include #include #include #include namespace frostbite2D { class FontManager { public: static FontManager& get(); bool init(); void shutdown(); bool registerFont(const std::string& name, const std::string& path, int fontSize); TTF_Font* getFont(const std::string& name); bool hasFont(const std::string& name) const; void unregisterFont(const std::string& name); void unloadAll(); struct FontInfo { std::string name; std::string path; int size = 0; }; std::optional getFontInfo(const std::string& name) const; FontManager(const FontManager&) = delete; FontManager& operator=(const FontManager&) = delete; private: FontManager() = default; ~FontManager(); std::unordered_map fonts_; std::unordered_map fontInfos_; }; }