23 #include <unordered_map> 28 #include FT_FREETYPE_H 67 virtual void loadFont(std::string fontFace,
int pixelSize);
77 struct FontDefinition{
80 FontDefinition(std::string face,
int pixelSize);
82 bool operator == (FontDefinition fd)
const;
84 std::string getFace()
const;
85 int getPixelSize()
const;
93 std::size_t operator()(FontDefinition
const& fd)
const 95 std::size_t h1 = std::hash<std::string>()(fd.getFace());
96 std::size_t h2 = std::hash<int>()(fd.getPixelSize());
97 return h1 ^ (h2 << 1);
104 typedef std::unordered_map<FontDefinition,Font*,FontDefHash> fontMap;
106 void iterateGlyphs(FontDefinition def,
unsigned int* width,
unsigned int* height);
109 GLuint*
getTex(
bool force) ;
112 FT_Library* ft_library;
113 unsigned int atlasWidth = 0, atlasHeight = 0;
114 bool initiated =
false;
Font * loadAndFetchFont(std::string fontFace, int pixelSize)
virtual void loadFont(std::string fontFace, int pixelSize)
static FontManager * getInstance()