diff options
| author | Yuri Sizov <11782833+YuriSizov@users.noreply.github.com> | 2023-03-14 13:57:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-14 13:57:36 +0100 |
| commit | 258ea41ffa00a71bbb6ba9844840f18ba5802816 (patch) | |
| tree | b615e78de7fff785e8d5e191b4401da99f44367d /modules/text_server_fb/text_server_fb.cpp | |
| parent | 30e81fcc26ee4e9394abe2504c6dd613b06a85db (diff) | |
| parent | 84e9a79ace17094a3d0f7cde5af2f35ce2c8986f (diff) | |
Merge pull request #74884 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.1) - 2nd batch
Diffstat (limited to 'modules/text_server_fb/text_server_fb.cpp')
| -rw-r--r-- | modules/text_server_fb/text_server_fb.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/text_server_fb/text_server_fb.cpp b/modules/text_server_fb/text_server_fb.cpp index d67ae6b45b..15124ad488 100644 --- a/modules/text_server_fb/text_server_fb.cpp +++ b/modules/text_server_fb/text_server_fb.cpp @@ -3262,7 +3262,7 @@ double TextServerFallback::_shaped_text_fit_to_width(const RID &p_shaped, double for (int i = start_pos; i <= end_pos; i++) { const Glyph &gl = sd->glyphs[i]; if (gl.count > 0) { - if ((gl.flags & GRAPHEME_IS_SPACE) == GRAPHEME_IS_SPACE) { + if ((gl.flags & GRAPHEME_IS_SPACE) == GRAPHEME_IS_SPACE && (gl.flags & GRAPHEME_IS_PUNCTUATION) != GRAPHEME_IS_PUNCTUATION) { space_count++; } } @@ -3273,7 +3273,7 @@ double TextServerFallback::_shaped_text_fit_to_width(const RID &p_shaped, double for (int i = start_pos; i <= end_pos; i++) { Glyph &gl = sd->glyphs.write[i]; if (gl.count > 0) { - if ((gl.flags & GRAPHEME_IS_SPACE) == GRAPHEME_IS_SPACE) { + if ((gl.flags & GRAPHEME_IS_SPACE) == GRAPHEME_IS_SPACE && (gl.flags & GRAPHEME_IS_PUNCTUATION) != GRAPHEME_IS_PUNCTUATION) { double old_adv = gl.advance; gl.advance = MAX(gl.advance + delta_width_per_space, Math::round(0.1 * gl.font_size)); justification_width += (gl.advance - old_adv); @@ -3372,7 +3372,7 @@ bool TextServerFallback::_shaped_text_update_breaks(const RID &p_shaped) { if (sd_glyphs[i].count > 0) { char32_t c = sd->text[sd_glyphs[i].start - sd->start]; if (c_punct_size == 0) { - if (is_punct(c) && c != 0x005F) { + if (is_punct(c) && c != 0x005F && c != ' ') { sd_glyphs[i].flags |= GRAPHEME_IS_PUNCTUATION; } } else { |