From a873df7a66dc1831cee4eae2d998abed88246268 Mon Sep 17 00:00:00 2001 From: fschildt Date: Thu, 16 Oct 2025 15:33:06 +0200 Subject: renderer: introduce text rendering --- src/common/Font.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/common/Font.hpp') diff --git a/src/common/Font.hpp b/src/common/Font.hpp index af4ddb5..876b03a 100644 --- a/src/common/Font.hpp +++ b/src/common/Font.hpp @@ -23,9 +23,9 @@ struct Glyph { class Font { public: + explicit Font(const char* path, int size); ~Font(); - bool Init(const char* path, int font_size); AlphaBitmap& GetAlphaBitmap(char32_t c); Glyph& GetGlyph(char32_t c); @@ -33,7 +33,7 @@ public: private: bool ReadFile(const char* path); - void LoadGlyph(Glyph& glyph, char32_t c); + void InitGlyph(Glyph& glyph, char32_t c); private: @@ -43,12 +43,12 @@ private: const char* m_file_content = nullptr; + stbtt_fontinfo m_font_info; float m_font_scale; int m_font_baseline; int m_font_yadvance; - stbtt_fontinfo m_font_info; Glyph m_glyphs[ascii_glyph_count]; Glyph m_fail_glyph; }; -- cgit v1.2.3