0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

Remove unused code.

This commit is contained in:
Bram Moolenaar
2010-08-08 16:38:42 +02:00
parent 83687a7215
commit 09092155a6
31 changed files with 15 additions and 714 deletions

View File

@@ -4484,52 +4484,6 @@ gui_mch_get_font(char_u *name, int report_error)
return NULL;
}
/*
* The fixed-width check has been disabled for GTK+ 2. Rationale:
*
* - The check tends to report false positives, particularly
* in non-Latin locales or with old X fonts.
* - Thanks to our fixed-width hack in gui_gtk2_draw_string(),
* GTK+ 2 Vim is actually capable of displaying variable width
* fonts. Those will just be spaced out like in AA xterm.
* - Failing here for the default font causes GUI startup to fail
* even with wiped out configuration files.
* - The font dialog displays all fonts unfiltered, and it's rather
* annoying if 95% of the listed fonts produce an error message.
*/
#if 0
{
/* Check that this is a mono-spaced font. Naturally, this is a bit
* hackish -- fixed-width isn't really suitable for i18n text :/ */
PangoLayout *layout;
unsigned int i;
int last_width = -1;
const char test_chars[] = { 'W', 'i', ',', 'x' }; /* arbitrary */
layout = pango_layout_new(gui.text_context);
pango_layout_set_font_description(layout, font);
for (i = 0; i < G_N_ELEMENTS(test_chars); ++i)
{
int width;
pango_layout_set_text(layout, &test_chars[i], 1);
pango_layout_get_size(layout, &width, NULL);
if (last_width >= 0 && width != last_width)
{
pango_font_description_free(font);
font = NULL;
break;
}
last_width = width;
}
g_object_unref(layout);
}
#endif
return font;
}