Files
esDashboard/src/display/ui/text/Fonts.h
T
2025-12-29 13:39:40 +00:00

28 lines
696 B
C++

#pragma once
#include <memory>
#include <string>
#include <unordered_map>
#include "Display/UI/Text/Font.h"
#include "Display/UI/Text/Glyph.h"
#include "Display/UI/Text/GlyphKey.h"
namespace display::ui::text
{
class Fonts
{
public:
Fonts();
~Fonts();
const Glyph &getGlyph(char ch, const Font &key);
private:
struct Library;
struct Face;
std::unique_ptr<Library> library;
std::unordered_map<Font, std::unique_ptr<Face>, FontHash> fonts;
std::unordered_map<GlyphKey, Glyph, GlyphKeyHash> glyphs;
void loadAllFonts();
void loadFonts(const std::string &path);
};
} // namespace display::ui::text