aboutsummaryrefslogtreecommitdiff
path: root/src/common/Font.hpp
diff options
context:
space:
mode:
authorfschildt <florian.schildt@protonmail.com>2025-10-16 15:33:06 +0200
committerfschildt <florian.schildt@protonmail.com>2025-10-16 15:33:06 +0200
commita873df7a66dc1831cee4eae2d998abed88246268 (patch)
treec19cd079ce106e1431d64c34babf4ef59cf71723 /src/common/Font.hpp
parent9f2845b12135c32dde91e58afc1193d54333ec9f (diff)
renderer: introduce text rendering
Diffstat (limited to 'src/common/Font.hpp')
-rw-r--r--src/common/Font.hpp6
1 files changed, 3 insertions, 3 deletions
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;
};