To: vim_dev@googlegroups.com Subject: Patch 7.4.2214 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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) Files: src/gui_gtk_x11.c *** ../vim-7.4.2213/src/gui_gtk_x11.c 2016-08-12 14:08:20.682029419 +0200 --- src/gui_gtk_x11.c 2016-08-14 20:23:19.913121162 +0200 *************** *** 5239,5245 **** static void ascii_glyph_table_init(void) { ! char_u ascii_chars[128]; PangoAttrList *attr_list; GList *item_list; int i; --- 5239,5245 ---- static void ascii_glyph_table_init(void) { ! char_u ascii_chars[2 * 128]; PangoAttrList *attr_list; GList *item_list; int i; *************** *** 5252,5263 **** 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] = '?'; attr_list = pango_attr_list_new(); item_list = pango_itemize(gui.text_context, (const char *)ascii_chars, --- 5252,5267 ---- gui.ascii_glyphs = NULL; gui.ascii_font = NULL; ! /* 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,5952 **** for (i = 0; i < len; ++i) { ! glyphs->glyphs[i] = gui.ascii_glyphs->glyphs[s[i]]; glyphs->log_clusters[i] = i; } --- 5950,5956 ---- for (i = 0; i < len; ++i) { ! glyphs->glyphs[i] = gui.ascii_glyphs->glyphs[2 * s[i]]; glyphs->log_clusters[i] = i; } *** ../vim-7.4.2213/src/version.c 2016-08-14 19:54:16.332930147 +0200 --- src/version.c 2016-08-14 20:19:13.775353363 +0200 *************** *** 765,766 **** --- 765,768 ---- { /* Add new patch number below this line */ + /**/ + 2214, /**/ -- Far out in the uncharted backwaters of the unfashionable end of the Western Spiral arm of the Galaxy lies a small unregarded yellow sun. Orbiting this at a distance of roughly ninety-eight million miles is an utterly insignificant little blue-green planet whose ape-descended life forms are so amazingly primitive that they still think digital watches are a pretty neat idea ... -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///