Skip to content

Commit e68a08a

Browse files
asliturkawesomekling
authored andcommitted
LibGfx: Add new methods to Font to avoid embedded values in FontEditor
1 parent 6f2837c commit e68a08a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Libraries/LibGfx/Font.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ class Font : public RefCounted<Font> {
9191
u8 glyph_height() const { return m_glyph_height; }
9292
u8 min_glyph_width() const { return m_min_glyph_width; }
9393
u8 max_glyph_width() const { return m_max_glyph_width; }
94+
u8 glyph_fixed_width() const { return m_glyph_width; }
95+
9496
int width(const StringView&) const;
9597
int width(const Utf8View&) const;
9698

@@ -109,12 +111,15 @@ class Font : public RefCounted<Font> {
109111
m_glyph_widths[(u8)ch] = width;
110112
}
111113

114+
int glyph_count() { return m_glyph_count; }
115+
112116
private:
113117
Font(const StringView& name, unsigned* rows, u8* widths, bool is_fixed_width, u8 glyph_width, u8 glyph_height, u8 glyph_spacing);
114118

115119
static RefPtr<Font> load_from_memory(const u8*);
116120

117121
String m_name;
122+
size_t m_glyph_count { 256 };
118123

119124
unsigned* m_rows { nullptr };
120125
u8* m_glyph_widths { nullptr };

0 commit comments

Comments
 (0)