/* * Copyright (c) 2022, Matthew Olsson * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include namespace PDF { class PDFFont : public RefCounted { public: enum class Type { Type0, Type1, TrueType }; static PDFErrorOr> create(Document*, NonnullRefPtr const&, float font_size); virtual ~PDFFont() = default; virtual PDFErrorOr draw_string(Gfx::Painter&, Gfx::FloatPoint, DeprecatedString const&, Color const&, float font_size, float character_spacing, float horizontal_scaling) = 0; virtual Type type() const = 0; DeprecatedFlyString base_font_name() const { return m_base_font_name; }; protected: virtual PDFErrorOr initialize(Document* document, NonnullRefPtr const& dict, float font_size); static PDFErrorOr> replacement_for(StringView name, float font_size); private: DeprecatedFlyString m_base_font_name; }; }