mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 12:49:08 +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:
@@ -7,12 +7,12 @@
|
||||
|
||||
#include <AK/TypeCasts.h>
|
||||
#include <LibCore/DirIterator.h>
|
||||
#include <LibGfx/Font/FontDatabase.h>
|
||||
#include <LibWeb/CSS/Clip.h>
|
||||
#include <LibWeb/CSS/StyleProperties.h>
|
||||
#include <LibWeb/FontCache.h>
|
||||
#include <LibWeb/Layout/BlockContainer.h>
|
||||
#include <LibWeb/Layout/Node.h>
|
||||
#include <LibWeb/Platform/FontPlugin.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
@@ -99,15 +99,15 @@ Color StyleProperties::color_or_fallback(CSS::PropertyID id, Layout::NodeWithSty
|
||||
NonnullRefPtr<Gfx::Font> StyleProperties::font_fallback(bool monospace, bool bold)
|
||||
{
|
||||
if (monospace && bold)
|
||||
return Gfx::FontDatabase::default_fixed_width_font().bold_variant();
|
||||
return Platform::FontPlugin::the().default_fixed_width_font().bold_variant();
|
||||
|
||||
if (monospace)
|
||||
return Gfx::FontDatabase::default_fixed_width_font();
|
||||
return Platform::FontPlugin::the().default_fixed_width_font();
|
||||
|
||||
if (bold)
|
||||
return Gfx::FontDatabase::default_font().bold_variant();
|
||||
return Platform::FontPlugin::the().default_font().bold_variant();
|
||||
|
||||
return Gfx::FontDatabase::default_font();
|
||||
return Platform::FontPlugin::the().default_font();
|
||||
}
|
||||
|
||||
float StyleProperties::line_height(Layout::Node const& layout_node) const
|
||||
|
||||
Reference in New Issue
Block a user