1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:38:10 +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

@ -5,7 +5,6 @@
*/
#include <AK/Demangle.h>
#include <LibGfx/Font/FontDatabase.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/Dump.h>
#include <LibWeb/HTML/BrowsingContext.h>
@ -15,6 +14,7 @@
#include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Layout/Node.h>
#include <LibWeb/Layout/TextNode.h>
#include <LibWeb/Platform/FontPlugin.h>
#include <typeinfo>
namespace Web::Layout {
@ -198,7 +198,7 @@ NodeWithStyle::NodeWithStyle(DOM::Document& document, DOM::Node* node, CSS::Comp
, m_computed_values(move(computed_values))
{
m_has_style = true;
m_font = Gfx::FontDatabase::default_font();
m_font = Platform::FontPlugin::the().default_font();
}
void NodeWithStyle::did_insert_into_layout_tree(CSS::StyleProperties const&)