mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Support multiple emoji/symbol fonts
This commit is contained in:
parent
01ad180182
commit
abcc5bc16d
Notes:
github-actions[bot]
2025-11-03 09:57:33 +00:00
Author: https://github.com/socram8888
Commit: abcc5bc16d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6665
Reviewed-by: https://github.com/AtkinsSJ ✅
4 changed files with 20 additions and 18 deletions
|
|
@ -40,6 +40,16 @@ FontPlugin::FontPlugin(bool is_layout_test_mode, Gfx::SystemFontProvider* font_p
|
|||
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);
|
||||
VERIFY(m_default_fixed_width_font);
|
||||
|
||||
if (is_layout_test_mode) {
|
||||
m_symbol_font_names = { "Noto Emoji"_fly_string };
|
||||
} else {
|
||||
#ifdef AK_OS_MACOS
|
||||
m_symbol_font_names = { "Apple Color Emoji"_fly_string, "Apple Symbols"_fly_string };
|
||||
#else
|
||||
m_symbol_font_names = { "Noto Color Emoji"_fly_string, "Noto Sans Symbols"_fly_string };
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
FontPlugin::~FontPlugin() = default;
|
||||
|
|
@ -54,21 +64,9 @@ Gfx::Font& FontPlugin::default_fixed_width_font()
|
|||
return *m_default_fixed_width_font;
|
||||
}
|
||||
|
||||
RefPtr<Gfx::Font> FontPlugin::default_emoji_font(float point_size)
|
||||
Vector<FlyString> FontPlugin::symbol_font_names()
|
||||
{
|
||||
FlyString default_emoji_font_name;
|
||||
|
||||
if (m_is_layout_test_mode) {
|
||||
default_emoji_font_name = "Noto Emoji"_fly_string;
|
||||
} else {
|
||||
#ifdef AK_OS_MACOS
|
||||
default_emoji_font_name = "Apple Color Emoji"_fly_string;
|
||||
#else
|
||||
default_emoji_font_name = "Noto Color Emoji"_fly_string;
|
||||
#endif
|
||||
}
|
||||
|
||||
return Gfx::FontDatabase::the().get(default_emoji_font_name, point_size, 400, Gfx::FontWidth::Normal, 0);
|
||||
return m_symbol_font_names;
|
||||
}
|
||||
|
||||
#ifdef USE_FONTCONFIG
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue