[Fallback TextServer] Add support for non breaking spaces.

This commit is contained in:
bruvzg 2024-02-14 20:16:07 +02:00
parent 907db8eebc
commit 12883925c2
No known key found for this signature in database
GPG key ID: 7960FCF39844EC38

View file

@ -3625,7 +3625,9 @@ bool TextServerFallback::_shaped_text_update_breaks(const RID &p_shaped) {
}
if (is_whitespace(c) && !is_linebreak(c)) {
sd_glyphs[i].flags |= GRAPHEME_IS_SPACE;
sd_glyphs[i].flags |= GRAPHEME_IS_BREAK_SOFT;
if (c != 0x00A0 && c != 0x202F && c != 0x2060 && c != 0x2007) { // Skip for non-breaking space variants.
sd_glyphs[i].flags |= GRAPHEME_IS_BREAK_SOFT;
}
}
if (is_linebreak(c)) {
sd_glyphs[i].flags |= GRAPHEME_IS_SPACE;