1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 23:25:06 +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

@ -953,7 +953,7 @@ void StyleComputer::compute_font(StyleProperties& style, DOM::Element const* ele
if (parent_element && parent_element->computed_css_values())
font_metrics = parent_element->computed_css_values()->computed_font().pixel_metrics();
else
font_metrics = Gfx::FontDatabase::default_font().pixel_metrics();
font_metrics = Platform::FontPlugin::the().default_font().pixel_metrics();
auto parent_font_size = [&]() -> float {
if (!parent_element || !parent_element->computed_css_values())