diff options
author | Andreas Kling <kling@serenityos.org> | 2023-01-06 11:57:59 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-01-06 12:02:21 +0100 |
commit | 70c0c1c845229ec8544fe3184ebfbed5503c2726 (patch) | |
tree | 38e70292ab4f6659ea93bfa138c0ecfe0db29d83 /Userland/Libraries/LibWeb | |
parent | b2d3ceaec51cb0dce4ef01cd972340e0abf78fb5 (diff) | |
download | serenity-70c0c1c845229ec8544fe3184ebfbed5503c2726.zip |
LibWeb: Use default system fonts for `serif`, `sans-serif`, etc.
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r-- | Userland/Libraries/LibWeb/Platform/FontPluginSerenity.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Userland/Libraries/LibWeb/Platform/FontPluginSerenity.cpp b/Userland/Libraries/LibWeb/Platform/FontPluginSerenity.cpp index 9aa29b8eaa..c860977dff 100644 --- a/Userland/Libraries/LibWeb/Platform/FontPluginSerenity.cpp +++ b/Userland/Libraries/LibWeb/Platform/FontPluginSerenity.cpp @@ -12,6 +12,9 @@ namespace Web::Platform { FontPluginSerenity::FontPluginSerenity() { + // NOTE: These will eventually get replaced by system defaults. + Gfx::FontDatabase::set_default_font_query("Katica 10 400 0"); + Gfx::FontDatabase::set_fixed_width_font_query("Csilla 10 400 0"); } FontPluginSerenity::~FontPluginSerenity() = default; @@ -28,18 +31,16 @@ Gfx::Font& FontPluginSerenity::default_fixed_width_font() DeprecatedString FontPluginSerenity::generic_font_name(GenericFont generic_font) { - // FIXME: Replace hard-coded font names with a relevant call to FontDatabase. - // Currently, we cannot request the default font's name, or request it at a specific size and weight. - // So, hard-coded font names it is. + // FIXME: Make these configurable at the browser settings level. Fall back to system defaults. switch (generic_font) { case GenericFont::SansSerif: case GenericFont::UiSansSerif: case GenericFont::Cursive: case GenericFont::UiRounded: - return "Katica"; + return default_font().family(); case GenericFont::Monospace: case GenericFont::UiMonospace: - return "Csilla"; + return default_fixed_width_font().family(); case GenericFont::Serif: case GenericFont::UiSerif: return "Roman"; |