summaryrefslogtreecommitdiff
path: root/modules/text_server_fb
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2022-09-25 23:05:17 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2022-09-25 23:07:30 +0300
commit8cdb482738604f191f67bde23a812711d0146dab (patch)
tree7236befb8fd241cc19fc61d71adf42e7e7b810a5 /modules/text_server_fb
parentef266183598401d89482c5d2035d7e4cd3f64cb9 (diff)
[TextServer] Always prefer main font over fallbacks, regardless of script/language support.
Diffstat (limited to 'modules/text_server_fb')
-rw-r--r--modules/text_server_fb/text_server_fb.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/text_server_fb/text_server_fb.cpp b/modules/text_server_fb/text_server_fb.cpp
index 7bed22fbb1..9ef0f0ad82 100644
--- a/modules/text_server_fb/text_server_fb.cpp
+++ b/modules/text_server_fb/text_server_fb.cpp
@@ -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 {