summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
diff options
context:
space:
mode:
authorSimon Wanner <skyrising@pvpctutorials.de>2022-04-09 11:18:46 +0200
committerAndreas Kling <kling@serenityos.org>2022-04-09 23:48:18 +0200
commitf386b0d43c87e359619afe92fbdd4d78daeea050 (patch)
tree2b9881a86291f8b7e2699e1711bed11a0d970576 /Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
parent17baf05c5a4255c2a9c18843c660508f20bfce73 (diff)
downloadserenity-f386b0d43c87e359619afe92fbdd4d78daeea050.zip
LibWeb: Migrate SC::FontLoader from TTF::Font to Gfx::VectorFont
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/StyleComputer.cpp')
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleComputer.cpp9
1 files changed, 5 insertions, 4 deletions
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 <LibGfx/Font/FontStyleMapping.h>
#include <LibGfx/Font/ScaledFont.h>
#include <LibGfx/Font/TrueType/Font.h>
+#include <LibGfx/Font/VectorFont.h>
#include <LibWeb/CSS/CSSFontFaceRule.h>
#include <LibWeb/CSS/CSSStyleRule.h>
#include <LibWeb/CSS/Parser/Parser.h>
@@ -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<Gfx::Font> 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<TTF::Font> m_ttf_font;
+ RefPtr<Gfx::VectorFont> m_vector_font;
};
static StyleSheet& default_stylesheet()