You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-21 14:57:09 +00:00
[TextServer] Improve font fallback for emojis.
This commit is contained in:
@@ -5644,6 +5644,15 @@ RID TextServerAdvanced::_find_sys_font_for_text(const RID &p_fdef, const String
|
|||||||
if (dvar.has(ital_tag) && dvar[ital_tag].operator int() == 1) {
|
if (dvar.has(ital_tag) && dvar[ital_tag].operator int() == 1) {
|
||||||
font_style.set_flag(TextServer::FONT_ITALIC);
|
font_style.set_flag(TextServer::FONT_ITALIC);
|
||||||
}
|
}
|
||||||
|
if (p_script_code == "Zsye") {
|
||||||
|
#if defined(MACOS_ENABLED) || defined(APPLE_EMBEDDED_ENABLED)
|
||||||
|
font_name = "Apple Color Emoji";
|
||||||
|
#elif defined(WINDOWS_ENABLED)
|
||||||
|
font_name = "Segoe UI Emoji";
|
||||||
|
#else
|
||||||
|
font_name = "Noto Color Emoji";
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
String locale = (p_language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : p_language;
|
String locale = (p_language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : p_language;
|
||||||
PackedStringArray fallback_font_name = OS::get_singleton()->get_system_font_path_for_text(font_name, p_text, locale, p_script_code, font_weight, font_stretch, font_style & TextServer::FONT_ITALIC);
|
PackedStringArray fallback_font_name = OS::get_singleton()->get_system_font_path_for_text(font_name, p_text, locale, p_script_code, font_weight, font_stretch, font_style & TextServer::FONT_ITALIC);
|
||||||
|
|||||||
Reference in New Issue
Block a user