From 92a6d45a57f5eddedee108b019da471ae8e61601 Mon Sep 17 00:00:00 2001 From: Matan Ziv-Av Date: Tue, 21 Jun 2022 17:55:46 +0300 Subject: [PATCH] Revert commit 60b0c9d Commit 60b0c9d breaks bidi rendering, essentialy making all spaces hard L2R characters, instead of neutral. The deleted mostly does not do anything - it groups a sequence of space which would be grouped anyway. The problem is the break at the end, which exits the outer loop so stops grouping after any sequence of space. It "works" by having more groups, thus the rendering is closer to rendering each character in its place, mitigating somewhat the issue caused by non-fixed fonts (fallback to a font with different width). --- src/terminalDisplay/TerminalPainter.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/terminalDisplay/TerminalPainter.cpp b/src/terminalDisplay/TerminalPainter.cpp index b2a17dab..5524af04 100644 --- a/src/terminalDisplay/TerminalPainter.cpp +++ b/src/terminalDisplay/TerminalPainter.cpp @@ -145,24 +145,6 @@ void TerminalPainter::drawContents(Character *image, break; } - // Group spaces following any non-wide character with the character. This allows for - // rendering ambiguous characters with wide glyphs without clipping them. - // NOTE: This happens in the else case too, but we need it here as well. - if (!doubleWidth && next_char.character == ' ' && char_value.equalsFormat(next_char)) { - univec << next_char.character; - len++; - while (isInsideDrawArea(x + len)) { - const Character next_char_gp = image[m_parentDisplay->loc(x + len, y)]; - if (next_char_gp.character == ' ' && char_value.hasSameColors(next_char_gp) && char_value.hasSameRendition(next_char_gp)) { - univec << next_char_gp.character; - len++; - } else { - break; - } - } - break; - } - const uint c = next_char.character; if ((next_char.rendition & RE_EXTENDED_CHAR) != 0) { // sequence of characters