From 0261bd001bf0aef052525a4ba126bb6fabc77868 Mon Sep 17 00:00:00 2001 From: Michael Jennings Date: Tue, 6 Jan 2009 07:51:15 +0000 Subject: [PATCH] Mon Jan 5 23:50:28 2009 Michael Jennings (mej) Remove fontset fallbacks. I think this might help speed up the load time slowness some people are seeing. Let's find out. ---------------------------------------------------------------------- SVN revision: 38477 --- ChangeLog | 5 +++++ src/command.c | 17 +++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7b5e91e..ed50338 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5586,3 +5586,8 @@ Tue Dec 16 22:03:54 2008 Michael Jennings (mej) Fix compile errors related to the removal of unnecessary typecasting macros. ---------------------------------------------------------------------- +Mon Jan 5 23:50:28 2009 Michael Jennings (mej) + +Remove fontset fallbacks. I think this might help speed up the load +time slowness some people are seeing. Let's find out. +---------------------------------------------------------------------- diff --git a/src/command.c b/src/command.c index 647fe3c..0e5f456 100644 --- a/src/command.c +++ b/src/command.c @@ -1853,33 +1853,34 @@ create_fontset(const char *font1, const char *font2) XFontSet fontset = 0; char *fontname, **ml, *ds; int mc; - const char fs_base[] = ",-misc-fixed-*-r-*-*-*-120-*-*-*-*-*-*,*"; + /*const char fs_base[] = ",-misc-fixed-*-r-*-*-*-120-*-*-*-*-*-*,*";*/ ASSERT_RVAL(font1 != NULL, (XFontSet) 0); if (font2) { - fontname = MALLOC(strlen(font1) + strlen(font2) + sizeof(fs_base) + 2); + fontname = MALLOC(strlen(font1) + strlen(font2) /*+ sizeof(fs_base)*/ + 2); if (fontname) { strcpy(fontname, font1); strcat(fontname, ","); strcat(fontname, font2); - strcat(fontname, fs_base); + /*strcat(fontname, fs_base);*/ } } else { - fontname = MALLOC(strlen(font1) + sizeof(fs_base) + 1); + fontname = MALLOC(strlen(font1) /*+ sizeof(fs_base)*/ + 1); if (fontname) { strcpy(fontname, font1); - strcat(fontname, fs_base); + /*strcat(fontname, fs_base);*/ } } if (fontname) { setlocale(LC_ALL, ""); - fontset = XCreateFontSet(Xdisplay, fontname, &ml, &mc, &ds); - D_FONT(("Created fontset from %s, %d missing charsets, default string \"%s\".\n", fontname, mc, NONULL(ds))); + fontset = XCreateFontSet(Xdisplay, fontname, &ml, &mc, NULL); + D_FONT(("Created fontset from %s, %d missing charsets (\"%s\").\n", fontname, mc, + ((mc > 0) ? (ml[0]) : ("N/A")))); FREE(fontname); if (mc) { XFreeStringList(ml); - fontset = 0; + /*fontset = 0;*/ } } return fontset;