# HG changeset patch # User Christian Brabandt # Date 1471199406 -7200 # Node ID 5cd29e15f2f723e04e97bae9a121c9b5c7f4c86a # Parent 1f21964a22f7bd9a2ed889a4e99a8fe0fec623c1 commit https://github.com/vim/vim/commit/16350cb97914bc86320185a9910b23c2b297d273 Author: Bram Moolenaar Date: Sun Aug 14 20:27:34 2016 +0200 patch 7.4.2214 Problem: A font that uses ligatures messes up the screen display. Solution: Put spaces between characters when building the glyph table. (based on a patch from Manuel Schiller) diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -5239,7 +5239,7 @@ static PangoEngineShape *default_shape_e static void ascii_glyph_table_init(void) { - char_u ascii_chars[128]; + char_u ascii_chars[2 * 128]; PangoAttrList *attr_list; GList *item_list; int i; @@ -5252,12 +5252,16 @@ ascii_glyph_table_init(void) gui.ascii_glyphs = NULL; gui.ascii_font = NULL; - /* For safety, fill in question marks for the control characters. */ - for (i = 0; i < 32; ++i) - ascii_chars[i] = '?'; - for (; i < 127; ++i) - ascii_chars[i] = i; - ascii_chars[i] = '?'; + /* For safety, fill in question marks for the control characters. + * Put a space between characters to avoid shaping. */ + for (i = 0; i < 128; ++i) + { + if (i >= 32 && i < 127) + ascii_chars[2 * i] = i; + else + ascii_chars[2 * i] = '?'; + ascii_chars[2 * i + 1] = ' '; + } attr_list = pango_attr_list_new(); item_list = pango_itemize(gui.text_context, (const char *)ascii_chars, @@ -5946,7 +5950,7 @@ gui_gtk2_draw_string(int row, int col, c for (i = 0; i < len; ++i) { - glyphs->glyphs[i] = gui.ascii_glyphs->glyphs[s[i]]; + glyphs->glyphs[i] = gui.ascii_glyphs->glyphs[2 * s[i]]; glyphs->log_clusters[i] = i; } diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2214, +/**/ 2213, /**/ 2212,