diff options
author | thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> | 2021-09-23 19:11:45 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-24 14:59:39 +0200 |
commit | fff89ad769c1771125ff3ba4d48bfd9a6c36a455 (patch) | |
tree | c4f6ec8d53d4bcff2b347f47f95f0c0705745958 /Userland/Libraries/LibGfx/BitmapFont.h | |
parent | 07419b89314d73ee5f10ab1b3a1aadb16f311cf9 (diff) | |
download | serenity-fff89ad769c1771125ff3ba4d48bfd9a6c36a455.zip |
LibGfx: Support italic BitmapFonts
BitmapFont header now contains a slope byte. Slope is used to
indicate slant style and is mapped in LibGfx/FontStyleMapping.h
Diffstat (limited to 'Userland/Libraries/LibGfx/BitmapFont.h')
-rw-r--r-- | Userland/Libraries/LibGfx/BitmapFont.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGfx/BitmapFont.h b/Userland/Libraries/LibGfx/BitmapFont.h index 9cdea48167..99594b5ff0 100644 --- a/Userland/Libraries/LibGfx/BitmapFont.h +++ b/Userland/Libraries/LibGfx/BitmapFont.h @@ -36,6 +36,9 @@ public: u16 weight() const override { return m_weight; } void set_weight(u16 weight) { m_weight = weight; } + u8 slope() const { return m_slope; } + void set_slope(u8 slope) { m_slope = slope; } + Glyph glyph(u32 code_point) const override; Glyph raw_glyph(u32 code_point) const; bool contains_glyph(u32 code_point) const override; @@ -104,7 +107,7 @@ public: private: BitmapFont(String name, String family, u32* rows, u8* widths, bool is_fixed_width, u8 glyph_width, u8 glyph_height, u8 glyph_spacing, u16 range_mask_size, u8* range_mask, - u8 baseline, u8 mean_line, u8 presentation_size, u16 weight, bool owns_arrays = false); + u8 baseline, u8 mean_line, u8 presentation_size, u16 weight, u8 slope, bool owns_arrays = false); static RefPtr<BitmapFont> load_from_memory(u8 const*); @@ -136,6 +139,7 @@ private: u8 m_mean_line { 0 }; u8 m_presentation_size { 0 }; u16 m_weight { 0 }; + u8 m_slope { 0 }; bool m_fixed_width { false }; bool m_owns_arrays { false }; |