summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHüseyin ASLITÜRK <asliturk@hotmail.com>2020-05-08 23:06:33 +0300
committerAndreas Kling <kling@serenityos.org>2020-05-09 10:00:13 +0200
commite68a08ad7cb34d7df8326c0431d8ae0d718cbc29 (patch)
tree022792167f66ae4e350a5cdfc00f87693b3b671d
parent6f2837cb130261da5747716bddaaefc75793c8ab (diff)
downloadserenity-e68a08ad7cb34d7df8326c0431d8ae0d718cbc29.zip
LibGfx: Add new methods to Font to avoid embedded values in FontEditor
-rw-r--r--Libraries/LibGfx/Font.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Libraries/LibGfx/Font.h b/Libraries/LibGfx/Font.h
index 60b2d32340..1580f25e11 100644
--- a/Libraries/LibGfx/Font.h
+++ b/Libraries/LibGfx/Font.h
@@ -91,6 +91,8 @@ public:
u8 glyph_height() const { return m_glyph_height; }
u8 min_glyph_width() const { return m_min_glyph_width; }
u8 max_glyph_width() const { return m_max_glyph_width; }
+ u8 glyph_fixed_width() const { return m_glyph_width; }
+
int width(const StringView&) const;
int width(const Utf8View&) const;
@@ -109,12 +111,15 @@ public:
m_glyph_widths[(u8)ch] = width;
}
+ int glyph_count() { return m_glyph_count; }
+
private:
Font(const StringView& name, unsigned* rows, u8* widths, bool is_fixed_width, u8 glyph_width, u8 glyph_height, u8 glyph_spacing);
static RefPtr<Font> load_from_memory(const u8*);
String m_name;
+ size_t m_glyph_count { 256 };
unsigned* m_rows { nullptr };
u8* m_glyph_widths { nullptr };