From f386b0d43c87e359619afe92fbdd4d78daeea050 Mon Sep 17 00:00:00 2001 From: Simon Wanner Date: Sat, 9 Apr 2022 11:18:46 +0200 Subject: LibWeb: Migrate SC::FontLoader from TTF::Font to Gfx::VectorFont --- Userland/Libraries/LibWeb/CSS/StyleComputer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Userland/Libraries/LibWeb/CSS/StyleComputer.cpp') diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index 7f7f41f2dc..b6ee53a348 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -54,7 +55,7 @@ public: auto result = TTF::Font::try_load_from_externally_owned_memory(resource()->encoded_data()); if (result.is_error()) return; - m_ttf_font = result.release_value(); + m_vector_font = result.release_value(); m_style_computer.did_load_font(m_family_name); } @@ -64,15 +65,15 @@ public: RefPtr font_with_point_size(float point_size) const { - if (!m_ttf_font) + if (!m_vector_font) return nullptr; - return adopt_ref(*new Gfx::ScaledFont(*m_ttf_font, point_size, point_size)); + return adopt_ref(*new Gfx::ScaledFont(*m_vector_font, point_size, point_size)); } private: StyleComputer& m_style_computer; FlyString m_family_name; - RefPtr m_ttf_font; + RefPtr m_vector_font; }; static StyleSheet& default_stylesheet() -- cgit v1.2.3