diff --git a/Userland/Libraries/LibGfx/Font/BitmapFont.h b/Userland/Libraries/LibGfx/Font/BitmapFont.h index 2272709af3..f37895f91e 100644 --- a/Userland/Libraries/LibGfx/Font/BitmapFont.h +++ b/Userland/Libraries/LibGfx/Font/BitmapFont.h @@ -21,7 +21,7 @@ namespace Gfx { class BitmapFont final : public Font { public: virtual NonnullRefPtr clone() const override; - ErrorOr> try_clone() const; + ErrorOr> try_clone() const override; static NonnullRefPtr create(u8 glyph_height, u8 glyph_width, bool fixed, size_t glyph_count); static ErrorOr> try_create(u8 glyph_height, u8 glyph_width, bool fixed, size_t glyph_count); diff --git a/Userland/Libraries/LibGfx/Font/Font.h b/Userland/Libraries/LibGfx/Font/Font.h index be60b72546..547a1b6b0f 100644 --- a/Userland/Libraries/LibGfx/Font/Font.h +++ b/Userland/Libraries/LibGfx/Font/Font.h @@ -112,6 +112,7 @@ public: }; virtual NonnullRefPtr clone() const = 0; + virtual ErrorOr> try_clone() const = 0; virtual ~Font() {}; virtual FontPixelMetrics pixel_metrics() const = 0; diff --git a/Userland/Libraries/LibGfx/Font/ScaledFont.h b/Userland/Libraries/LibGfx/Font/ScaledFont.h index 95e19395ef..bb41f98382 100644 --- a/Userland/Libraries/LibGfx/Font/ScaledFont.h +++ b/Userland/Libraries/LibGfx/Font/ScaledFont.h @@ -33,7 +33,8 @@ public: RefPtr rasterize_glyph(u32 glyph_id) const; // ^Gfx::Font - virtual NonnullRefPtr clone() const override { return *this; } // FIXME: clone() should not need to be implemented + virtual NonnullRefPtr clone() const override { return MUST(try_clone()); } // FIXME: clone() should not need to be implemented + virtual ErrorOr> try_clone() const override { return *this; } 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; }