#pragma once #include #include struct MonoBitmap { int32_t w; int32_t h; std::unique_ptr pixels; }; struct Glyph { int32_t xoff; int32_t yoff; int32_t xadvance; MonoBitmap bitmap; }; class Font { public: ~Font(); bool Init(const char* path, int font_size); void Deinit(); void LoadGlyph(Glyph& glyph, uint32_t codepoint); private: const char* m_file_content = nullptr; float m_font_scale; int m_font_baseline; int m_font_yadvance; stbtt_fontinfo m_font_info; Glyph m_glyphs['~' - ' ' + 1]; };