mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
LibWeb: Use default system fonts for serif
, sans-serif
, etc.
This commit is contained in:
parent
b2d3ceaec5
commit
70c0c1c845
Notes:
sideshowbarker
2024-07-17 16:23:55 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/70c0c1c845
1 changed files with 6 additions and 5 deletions
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue