summaryrefslogtreecommitdiffstats
path: root/src/gui_gtk_x11.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-08-08 14:40:37 +0200
committerBram Moolenaar <Bram@vim.org>2010-08-08 14:40:37 +0200
commit96118f3e3817f2ce4df21079ed32ee2961983c12 (patch)
tree7496af1793db342ec8f1fcbeb407b6af668a91dc /src/gui_gtk_x11.c
parent2d231cb89c2586a9ba94d8d0e5ca7d761c56e0de (diff)
Improve positioning of combining characters in GTK.
Diffstat (limited to 'src/gui_gtk_x11.c')
-rw-r--r--src/gui_gtk_x11.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 04b0ecb9d0..2a4b520640 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -5109,13 +5109,20 @@ not_ascii:
/* There is a previous glyph, so we deal with combining
* characters the canonical way.
- * Older versions of Pango used a positive x_offset,
- * then set the width of the previous glyph to zero.
- * Newer versions of Pango use a negative x_offset.
+ * In some circumstances Pango uses a positive x_offset,
+ * then use the width of the previous glyph for this one
+ * and set the previous width to zero.
+ * Otherwise we get a negative x_offset, Pango has already
+ * positioned the combining char, keep the widths as they
+ * are.
* For both adjust the x_offset to position the glyph in
- * the middle. */
+ * the middle. */
if (glyph->geometry.x_offset >= 0)
+ {
+ glyphs->glyphs[i].geometry.width =
+ glyphs->glyphs[i - 1].geometry.width;
glyphs->glyphs[i - 1].geometry.width = 0;
+ }
width = cells * gui.char_width * PANGO_SCALE;
glyph->geometry.x_offset +=
MAX(0, width - cluster_width) / 2;