mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 14:19:48 +00:00
LibWeb+LibWebView: Allow to specify default font size in FontPlugin
Instead of always assuming 12pt size for default font, explicitly pass it as a parameter.
This commit is contained in:
parent
1be55fe793
commit
0b8b690f92
Notes:
github-actions[bot]
2025-01-02 09:48:33 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 0b8b690f92
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3101
9 changed files with 22 additions and 24 deletions
|
@ -42,9 +42,7 @@ FontPlugin::FontPlugin(bool is_layout_test_mode, Gfx::SystemFontProvider* font_p
|
|||
|
||||
update_generic_fonts();
|
||||
|
||||
auto default_font_name = generic_font_name(Web::Platform::GenericFont::UiSansSerif);
|
||||
m_default_font = Gfx::FontDatabase::the().get(default_font_name, 12.0, 400, Gfx::FontWidth::Normal, 0);
|
||||
VERIFY(m_default_font);
|
||||
m_default_font_name = generic_font_name(Web::Platform::GenericFont::UiSansSerif);
|
||||
|
||||
auto default_fixed_width_font_name = generic_font_name(Web::Platform::GenericFont::UiMonospace);
|
||||
m_default_fixed_width_font = Gfx::FontDatabase::the().get(default_fixed_width_font_name, 12.0, 400, Gfx::FontWidth::Normal, 0);
|
||||
|
@ -53,9 +51,9 @@ FontPlugin::FontPlugin(bool is_layout_test_mode, Gfx::SystemFontProvider* font_p
|
|||
|
||||
FontPlugin::~FontPlugin() = default;
|
||||
|
||||
Gfx::Font& FontPlugin::default_font()
|
||||
RefPtr<Gfx::Font> FontPlugin::default_font(float point_size)
|
||||
{
|
||||
return *m_default_font;
|
||||
return Gfx::FontDatabase::the().get(m_default_font_name, point_size, 400, Gfx::FontWidth::Normal, 0);
|
||||
}
|
||||
|
||||
Gfx::Font& FontPlugin::default_fixed_width_font()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue