1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

Fix goof in Pango bidi suppression.

When we're displaying bidirectionally active text (that is, text that
the Unicode bidi algorithm will fiddle with), we need to suppress
Pango's bidi because we've already done our own. We were doing this by
calling is_rtl() on each character, and if it returned true,
displaying just that character in a separate Pango call.

Except that, ahem, we were only doing this if the _first_ character
encountered during a scan of the display buffer was rtl-sensitive. If
the first one was fine but a subsequent one was rtl-sensitive, then
that one would just get shoved into the buffer we'd already started.

Running pterm -fn 'client:Monospace 12' and displaying
testdata/utf8.txt now works again.
This commit is contained in:
Simon Tatham 2016-03-20 20:04:26 +00:00
parent eb4730e0bf
commit 6ef6cb1573

View File

@ -1543,7 +1543,8 @@ static void pangofont_draw_internal(unifont_drawctx *ctx, unifont *font,
(unsigned char)utfptr[clen] < 0xC0)
clen++;
n++;
if (pangofont_char_width(layout, pfont,
if (is_rtl(string[n-1]) ||
pangofont_char_width(layout, pfont,
string[n-1], utfptr + oldclen,
clen - oldclen) != desired) {
clen = oldclen;