mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-16 02:28:05 -05:00
Suppress Pango's bidi, by displaying RTL characters one at a time. I
hadn't previously noticed, but Pango was helpfully re-reversing text that PuTTY's own bidi module had already reversed, leading to Arabic text being wrongly displayed and also total chaos when you move the cursor over it or try to cut and paste it. [originally from svn r9294]
This commit is contained in:
parent
92688ff47b
commit
218f3ffded
@ -1114,6 +1114,13 @@ static void pangofont_draw_text(GdkDrawable *target, GdkGC *gc, unifont *font,
|
|||||||
clen++;
|
clen++;
|
||||||
n = 1;
|
n = 1;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If it's a right-to-left character, we must display it on
|
||||||
|
* its own, to stop Pango helpfully re-reversing our already
|
||||||
|
* reversed text.
|
||||||
|
*/
|
||||||
|
if (!is_rtl(string[0])) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* See if that character has the width we expect.
|
* See if that character has the width we expect.
|
||||||
*/
|
*/
|
||||||
@ -1142,6 +1149,7 @@ static void pangofont_draw_text(GdkDrawable *target, GdkGC *gc, unifont *font,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pango_layout_set_text(layout, utfptr, clen);
|
pango_layout_set_text(layout, utfptr, clen);
|
||||||
pango_layout_get_pixel_extents(layout, NULL, &rect);
|
pango_layout_get_pixel_extents(layout, NULL, &rect);
|
||||||
@ -1153,6 +1161,7 @@ static void pangofont_draw_text(GdkDrawable *target, GdkGC *gc, unifont *font,
|
|||||||
|
|
||||||
utflen -= clen;
|
utflen -= clen;
|
||||||
utfptr += clen;
|
utfptr += clen;
|
||||||
|
string += n;
|
||||||
x += n * cellwidth;
|
x += n * cellwidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user