summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-09-17 21:25:50 +0200
committerAndreas Kling <kling@serenityos.org>2022-09-17 21:27:32 +0200
commite72896e35e8516b9f71df18ff33de88a09ee47e6 (patch)
treed064a39a68435fd37cd669dd8567bd0539bc57ac /Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp
parent07a0d9df30a3660d5d0f06423a8aa7319b2fbf7d (diff)
downloadserenity-e72896e35e8516b9f71df18ff33de88a09ee47e6.zip
LibWeb: Get default fonts via Platform::FontPlugin
Instead of asking Gfx::FontDatabase for the "default font" and the "default fixed-width font", we now proxy those requests out via the Platform::FontPlugin. This will allow Ladybird to use other default fonts as fallback.
Diffstat (limited to 'Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp')
-rw-r--r--Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp b/Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp
index 9b3feb84db..31572e2807 100644
--- a/Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp
+++ b/Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp
@@ -9,6 +9,7 @@
#include <LibWeb/Layout/ImageBox.h>
#include <LibWeb/Painting/BorderRadiusCornerClipper.h>
#include <LibWeb/Painting/ImagePaintable.h>
+#include <LibWeb/Platform/FontPlugin.h>
namespace Web::Painting {
@@ -41,7 +42,7 @@ void ImagePaintable::paint(PaintContext& context, PaintPhase phase) const
if (phase == PaintPhase::Foreground) {
if (layout_box().renders_as_alt_text()) {
auto& image_element = verify_cast<HTML::HTMLImageElement>(*dom_node());
- context.painter().set_font(Gfx::FontDatabase::default_font());
+ context.painter().set_font(Platform::FontPlugin::the().default_font());
Gfx::StylePainter::paint_frame(context.painter(), enclosing_int_rect(absolute_rect()), context.palette(), Gfx::FrameShape::Container, Gfx::FrameShadow::Sunken, 2);
auto alt = image_element.alt();
if (alt.is_empty())