Fix punctuation after LTR at end of line

This commit is contained in:
Pk11
2021-01-27 23:48:49 -06:00
parent c71e6ff946
commit bbbb15c4bc
+5 -4
View File
@@ -266,13 +266,14 @@ ITCM_CODE void Font::print(std::u16string_view text, int x, int y, bool top, int
ltrBegin = it; ltrBegin = it;
// If on an RTL char right now, add one // If on an RTL char right now, add one
if(*it >= 0x0590 && *it <= 0x05FF) { if(*it >= 0x0590 && *it <= 0x05FF)
it++; it++;
// And skip all punctuation at the end if not at beginning
// Skip all punctuation at the end
while(*it < '0' || (*it > '9' && *it < 'A') || (*it > 'Z' && *it < 'a') || (*it > 'z' && *it < 127)) { while(*it < '0' || (*it > '9' && *it < 'A') || (*it > 'Z' && *it < 'a') || (*it > 'z' && *it < 127)) {
it++; if(it != text.begin())
ltrBegin++; ltrBegin++;
} it++;
} }
rtl = false; rtl = false;
} }