mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:57:44 +00:00
LibWeb: Use default system fonts for serif
, sans-serif
, etc.
This commit is contained in:
parent
b2d3ceaec5
commit
70c0c1c845
1 changed files with 6 additions and 5 deletions
|
@ -12,6 +12,9 @@ namespace Web::Platform {
|
||||||
|
|
||||||
FontPluginSerenity::FontPluginSerenity()
|
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;
|
FontPluginSerenity::~FontPluginSerenity() = default;
|
||||||
|
@ -28,18 +31,16 @@ Gfx::Font& FontPluginSerenity::default_fixed_width_font()
|
||||||
|
|
||||||
DeprecatedString FontPluginSerenity::generic_font_name(GenericFont generic_font)
|
DeprecatedString FontPluginSerenity::generic_font_name(GenericFont generic_font)
|
||||||
{
|
{
|
||||||
// FIXME: Replace hard-coded font names with a relevant call to FontDatabase.
|
// FIXME: Make these configurable at the browser settings level. Fall back to system defaults.
|
||||||
// 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.
|
|
||||||
switch (generic_font) {
|
switch (generic_font) {
|
||||||
case GenericFont::SansSerif:
|
case GenericFont::SansSerif:
|
||||||
case GenericFont::UiSansSerif:
|
case GenericFont::UiSansSerif:
|
||||||
case GenericFont::Cursive:
|
case GenericFont::Cursive:
|
||||||
case GenericFont::UiRounded:
|
case GenericFont::UiRounded:
|
||||||
return "Katica";
|
return default_font().family();
|
||||||
case GenericFont::Monospace:
|
case GenericFont::Monospace:
|
||||||
case GenericFont::UiMonospace:
|
case GenericFont::UiMonospace:
|
||||||
return "Csilla";
|
return default_fixed_width_font().family();
|
||||||
case GenericFont::Serif:
|
case GenericFont::Serif:
|
||||||
case GenericFont::UiSerif:
|
case GenericFont::UiSerif:
|
||||||
return "Roman";
|
return "Roman";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue