diff options
author | thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> | 2021-04-10 13:14:15 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-11 01:16:34 +0200 |
commit | c283429196502ba011c4bb9c469146666ff65f81 (patch) | |
tree | 8b41fabcbae4149082ab6e0dcbaacead3511a161 /Userland/Libraries/LibGfx/BitmapFont.h | |
parent | 25bd4b33a72e7f862c3b864488ac7c73698fb22f (diff) | |
download | serenity-c283429196502ba011c4bb9c469146666ff65f81.zip |
LibGfx: Add a count to FontTypes and a helper to return type names
Diffstat (limited to 'Userland/Libraries/LibGfx/BitmapFont.h')
-rw-r--r-- | Userland/Libraries/LibGfx/BitmapFont.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Userland/Libraries/LibGfx/BitmapFont.h b/Userland/Libraries/LibGfx/BitmapFont.h index 47dfb29039..0636b9b3d1 100644 --- a/Userland/Libraries/LibGfx/BitmapFont.h +++ b/Userland/Libraries/LibGfx/BitmapFont.h @@ -36,12 +36,13 @@ namespace Gfx { +// Note: Perhaps put glyph count directly in header +// and sidestep FontType conflation/sync maintenance enum FontTypes { Default = 0, - LatinExtendedA = 1, - // There are many blocks between LatinExtendedA and Cyrrilic that has to be added later. - // Cyrrilic has to be switched to another number - Cyrillic = 2 + LatinExtendedA, + Cyrillic, + __Count }; class BitmapFont : public Font { @@ -118,11 +119,13 @@ public: const Font& bold_variant() const; + static size_t glyph_count_by_type(FontTypes type); + static String type_name_by_type(FontTypes type); + private: BitmapFont(String name, String family, unsigned* rows, u8* widths, bool is_fixed_width, u8 glyph_width, u8 glyph_height, u8 glyph_spacing, FontTypes type, u8 baseline, u8 mean_line, u8 presentation_size, u16 weight, bool owns_arrays = false); static RefPtr<BitmapFont> load_from_memory(const u8*); - static size_t glyph_count_by_type(FontTypes type); void update_x_height() { m_x_height = m_baseline - m_mean_line; }; |