From 9c27e2e7993c9ccd604f77219a1f07c1be22e75a Mon Sep 17 00:00:00 2001 From: mathias Date: Fri, 3 Jun 2005 07:22:27 +0000 Subject: deleted the "fallback"-code, which was one of the reasons for slowing down fluxbox in utf8-locales: if no fontset is found up to this point its because of a) no such font b) not supported locale if we try our best and enhance the basename-list and add some more generic patterns the xserver will give us a valid fontset .. which is good coz we have something to work with but which is BAD coz we return a valid fontset as if we have found the font the user wants .. so, every fallback in higher level code will fail coz we find a valid fontset by any meaning here. if no fontset can be found, the "fixed"-fontset should be there already. --- src/FbTk/XmbFontImp.cc | 46 ++-------------------------------------------- 1 file changed, 2 insertions(+), 44 deletions(-) diff --git a/src/FbTk/XmbFontImp.cc b/src/FbTk/XmbFontImp.cc index 53d94fe..364491f 100644 --- a/src/FbTk/XmbFontImp.cc +++ b/src/FbTk/XmbFontImp.cc @@ -138,56 +138,14 @@ XFontSet createFontSet(const char *fontname, bool& utf8mode) { #ifdef HAVE_SETLOCALE if (! fs) { - if (nmissing) XFreeStringList(missing); + if (nmissing) + XFreeStringList(missing); setlocale(LC_CTYPE, "C"); fs = XCreateFontSet(display, fontname, &missing, &nmissing, &def); setlocale(LC_CTYPE, orig_locale.c_str()); } -#endif // HAVE_SETLOCALE - - if (fs) { - XFontStruct **fontstructs; - char **fontnames; - XFontsOfFontSet(fs, &fontstructs, &fontnames); - fontname = fontnames[0]; - } - - getFontElement(fontname, weight, FONT_ELEMENT_SIZE, - "-medium-", "-bold-", "-demibold-", "-regular-", NULL); - getFontElement(fontname, slant, FONT_ELEMENT_SIZE, - "-r-", "-i-", "-o-", "-ri-", "-ro-", NULL); - getFontSize(fontname, &pixel_size); - - if (! strcmp(weight, "*")) - strncpy(weight, "medium", FONT_ELEMENT_SIZE); - if (! strcmp(slant, "*")) - strncpy(slant, "r", FONT_ELEMENT_SIZE); - if (pixel_size < 3) - pixel_size = 3; - else if (pixel_size > 97) - pixel_size = 97; - - buf_size = strlen(fontname) + (FONT_ELEMENT_SIZE * 2) + 64; - char *pattern2 = new char[buf_size]; - snprintf(pattern2, buf_size - 1, - "%s," - "-*-*-%s-%s-*-*-%d-*-*-*-*-*-*-*," - "-*-*-*-*-*-*-%d-*-*-*-*-*-*-*,*", - fontname, weight, slant, pixel_size, pixel_size); - fontname = pattern2; - - if (nmissing) - XFreeStringList(missing); - if (fs) - XFreeFontSet(display, fs); - - fs = XCreateFontSet(display, fontname, - &missing, &nmissing, &def); - delete [] pattern2; - -#ifdef HAVE_SETLOCALE if (utf8mode) setlocale(LC_CTYPE, orig_locale.c_str()); #endif // HAVE_SETLOCALE -- cgit v0.11.2