diff options
author | mathias <mathias> | 2005-06-03 07:22:27 (GMT) |
---|---|---|
committer | mathias <mathias> | 2005-06-03 07:22:27 (GMT) |
commit | 9c27e2e7993c9ccd604f77219a1f07c1be22e75a (patch) | |
tree | 300dade8e083128337f0386ecc1ab6cdd4e22ab4 /src/FbTk/XmbFontImp.cc | |
parent | 4e5c210688d54f6dbba5f39029c249e94d8a0b19 (diff) | |
download | fluxbox-9c27e2e7993c9ccd604f77219a1f07c1be22e75a.zip fluxbox-9c27e2e7993c9ccd604f77219a1f07c1be22e75a.tar.bz2 |
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.
Diffstat (limited to 'src/FbTk/XmbFontImp.cc')
-rw-r--r-- | src/FbTk/XmbFontImp.cc | 46 |
1 files 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) { | |||
138 | 138 | ||
139 | #ifdef HAVE_SETLOCALE | 139 | #ifdef HAVE_SETLOCALE |
140 | if (! fs) { | 140 | if (! fs) { |
141 | if (nmissing) XFreeStringList(missing); | 141 | if (nmissing) |
142 | XFreeStringList(missing); | ||
142 | 143 | ||
143 | setlocale(LC_CTYPE, "C"); | 144 | setlocale(LC_CTYPE, "C"); |
144 | fs = XCreateFontSet(display, fontname, | 145 | fs = XCreateFontSet(display, fontname, |
145 | &missing, &nmissing, &def); | 146 | &missing, &nmissing, &def); |
146 | setlocale(LC_CTYPE, orig_locale.c_str()); | 147 | setlocale(LC_CTYPE, orig_locale.c_str()); |
147 | } | 148 | } |
148 | #endif // HAVE_SETLOCALE | ||
149 | |||
150 | if (fs) { | ||
151 | XFontStruct **fontstructs; | ||
152 | char **fontnames; | ||
153 | XFontsOfFontSet(fs, &fontstructs, &fontnames); | ||
154 | fontname = fontnames[0]; | ||
155 | } | ||
156 | |||
157 | getFontElement(fontname, weight, FONT_ELEMENT_SIZE, | ||
158 | "-medium-", "-bold-", "-demibold-", "-regular-", NULL); | ||
159 | getFontElement(fontname, slant, FONT_ELEMENT_SIZE, | ||
160 | "-r-", "-i-", "-o-", "-ri-", "-ro-", NULL); | ||
161 | getFontSize(fontname, &pixel_size); | ||
162 | |||
163 | if (! strcmp(weight, "*")) | ||
164 | strncpy(weight, "medium", FONT_ELEMENT_SIZE); | ||
165 | if (! strcmp(slant, "*")) | ||
166 | strncpy(slant, "r", FONT_ELEMENT_SIZE); | ||
167 | if (pixel_size < 3) | ||
168 | pixel_size = 3; | ||
169 | else if (pixel_size > 97) | ||
170 | pixel_size = 97; | ||
171 | |||
172 | buf_size = strlen(fontname) + (FONT_ELEMENT_SIZE * 2) + 64; | ||
173 | char *pattern2 = new char[buf_size]; | ||
174 | snprintf(pattern2, buf_size - 1, | ||
175 | "%s," | ||
176 | "-*-*-%s-%s-*-*-%d-*-*-*-*-*-*-*," | ||
177 | "-*-*-*-*-*-*-%d-*-*-*-*-*-*-*,*", | ||
178 | fontname, weight, slant, pixel_size, pixel_size); | ||
179 | fontname = pattern2; | ||
180 | |||
181 | if (nmissing) | ||
182 | XFreeStringList(missing); | ||
183 | if (fs) | ||
184 | XFreeFontSet(display, fs); | ||
185 | |||
186 | fs = XCreateFontSet(display, fontname, | ||
187 | &missing, &nmissing, &def); | ||
188 | delete [] pattern2; | ||
189 | |||
190 | #ifdef HAVE_SETLOCALE | ||
191 | if (utf8mode) | 149 | if (utf8mode) |
192 | setlocale(LC_CTYPE, orig_locale.c_str()); | 150 | setlocale(LC_CTYPE, orig_locale.c_str()); |
193 | #endif // HAVE_SETLOCALE | 151 | #endif // HAVE_SETLOCALE |