1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 12:37:44 +00:00

LibPDF: Sink m_base_font_name from PDFFont into subclasses

/BaseFont is a required key for type 0, type 1, and truetype
font dictionaries, but not for type 3 font dictionaries.

This is mechanical; type 0 fonts don't even use this yet
(but probably should).

PDFFont::initialize() is now empty and could be removed,
but maybe we'll put stuff there again later, so I'm leaving
it around for a bit longer.
This commit is contained in:
Nico Weber 2023-11-14 08:37:53 -05:00 committed by Sam Atkins
parent 6c1da5db54
commit 7f999b1ff5
8 changed files with 16 additions and 7 deletions

View file

@ -23,14 +23,9 @@ public:
virtual void set_font_size(float font_size) = 0;
virtual PDFErrorOr<Gfx::FloatPoint> draw_string(Gfx::Painter&, Gfx::FloatPoint, DeprecatedString const&, Color const&, float font_size, float character_spacing, float word_spacing, float horizontal_scaling) = 0;
DeprecatedFlyString base_font_name() const { return m_base_font_name; }
protected:
virtual PDFErrorOr<void> initialize(Document* document, NonnullRefPtr<DictObject> const& dict, float font_size);
static PDFErrorOr<NonnullRefPtr<Gfx::Font>> replacement_for(StringView name, float font_size);
private:
DeprecatedFlyString m_base_font_name;
};
}