1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:48:11 +00:00

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.
This commit is contained in:
Andreas Kling 2022-09-17 21:25:50 +02:00
parent 07a0d9df30
commit e72896e35e
10 changed files with 33 additions and 14 deletions

View file

@ -15,6 +15,7 @@
#include <LibWeb/Painting/PaintableBox.h>
#include <LibWeb/Painting/ShadowPainting.h>
#include <LibWeb/Painting/StackingContext.h>
#include <LibWeb/Platform/FontPlugin.h>
namespace Web::Painting {
@ -158,7 +159,7 @@ void PaintableBox::paint(PaintContext& context, PaintPhase phase) const
paint_inspector_rect(border_rect, Color::Green);
paint_inspector_rect(content_rect, Color::Magenta);
auto& font = Gfx::FontDatabase::default_font();
auto& font = Platform::FontPlugin::the().default_font();
StringBuilder builder;
if (layout_box().dom_node())