diff --git a/Userland/Libraries/LibGfx/BitmapFont.h b/Userland/Libraries/LibGfx/BitmapFont.h index b02222489d..4a4932e876 100644 --- a/Userland/Libraries/LibGfx/BitmapFont.h +++ b/Userland/Libraries/LibGfx/BitmapFont.h @@ -37,6 +37,9 @@ public: u8 presentation_size() const override { return m_presentation_size; } void set_presentation_size(u8 size) { m_presentation_size = size; } + virtual int pixel_size() const override { return m_glyph_height; } + virtual float point_size() const override { return static_cast(m_glyph_height) * 0.75f; } + u16 weight() const override { return m_weight; } void set_weight(u16 weight) { m_weight = weight; } diff --git a/Userland/Libraries/LibGfx/Font.h b/Userland/Libraries/LibGfx/Font.h index 8596764533..256623b907 100644 --- a/Userland/Libraries/LibGfx/Font.h +++ b/Userland/Libraries/LibGfx/Font.h @@ -106,6 +106,8 @@ public: FontMetrics metrics(u32 code_point) const; virtual u8 presentation_size() const = 0; + virtual int pixel_size() const = 0; + virtual float point_size() const = 0; virtual u8 slope() const = 0; virtual u16 weight() const = 0; diff --git a/Userland/Libraries/LibGfx/TrueTypeFont/Font.h b/Userland/Libraries/LibGfx/TrueTypeFont/Font.h index 7e77053707..36be6d05c4 100644 --- a/Userland/Libraries/LibGfx/TrueTypeFont/Font.h +++ b/Userland/Libraries/LibGfx/TrueTypeFont/Font.h @@ -126,6 +126,8 @@ public: // Gfx::Font implementation virtual NonnullRefPtr clone() const override { return *this; } // FIXME: clone() should not need to be implemented virtual u8 presentation_size() const override { return m_point_height; } + virtual int pixel_size() const override { return m_point_height * 1.33333333f; } + virtual float point_size() const override { return m_point_height; } virtual u8 slope() const override { return m_font->slope(); } virtual u16 weight() const override { return m_font->weight(); } virtual Gfx::Glyph glyph(u32 code_point) const override;