mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
[TextServer] Always prefer main font over fallbacks, regardless of script/language support.
This commit is contained in:
parent
ef26618359
commit
8cdb482738
@ -5430,7 +5430,10 @@ bool TextServerAdvanced::shaped_text_shape(const RID &p_shaped) {
|
||||
Array fonts_scr_only;
|
||||
Array fonts_no_match;
|
||||
int font_count = span.fonts.size();
|
||||
for (int l = 0; l < font_count; l++) {
|
||||
if (font_count > 0) {
|
||||
fonts.push_back(sd->spans[k].fonts[0]);
|
||||
}
|
||||
for (int l = 1; l < font_count; l++) {
|
||||
if (font_is_script_supported(span.fonts[l], script)) {
|
||||
if (font_is_language_supported(span.fonts[l], span.language)) {
|
||||
fonts.push_back(sd->spans[k].fonts[l]);
|
||||
|
@ -2844,7 +2844,10 @@ bool TextServerFallback::shaped_text_add_string(const RID &p_shaped, const Strin
|
||||
// Pre-sort fonts, push fonts with the language support first.
|
||||
Array fonts_no_match;
|
||||
int font_count = p_fonts.size();
|
||||
for (int i = 0; i < font_count; i++) {
|
||||
if (font_count > 0) {
|
||||
span.fonts.push_back(p_fonts[0]);
|
||||
}
|
||||
for (int i = 1; i < font_count; i++) {
|
||||
if (font_is_language_supported(p_fonts[i], p_language)) {
|
||||
span.fonts.push_back(p_fonts[i]);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user