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.
mathias mathias
1 files changed,
2 insertions(+),
44 deletions(-)
jump to
M
src/FbTk/XmbFontImp.cc
→
src/FbTk/XmbFontImp.cc
@@ -138,56 +138,14 @@ }
#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