diff options
author | fluxgen <fluxgen> | 2004-08-10 11:57:35 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2004-08-10 11:57:35 (GMT) |
commit | 41249b77fb4db6041d53447ffdb49bfb4dd34ce8 (patch) | |
tree | 3a24477f278a93dc0edfda5f728483abdf1e37d3 /src/FbTk/XmbFontImp.cc | |
parent | 52cb3758861117dbd30c63fd2e24fad5e9900742 (diff) | |
download | fluxbox-41249b77fb4db6041d53447ffdb49bfb4dd34ce8.zip fluxbox-41249b77fb4db6041d53447ffdb49bfb4dd34ce8.tar.bz2 |
utf-8 fix, a fixed patch from Sergey Kuleshov
Diffstat (limited to 'src/FbTk/XmbFontImp.cc')
-rw-r--r-- | src/FbTk/XmbFontImp.cc | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/FbTk/XmbFontImp.cc b/src/FbTk/XmbFontImp.cc index 9f47d6e..d06f05d 100644 --- a/src/FbTk/XmbFontImp.cc +++ b/src/FbTk/XmbFontImp.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: XmbFontImp.cc,v 1.7 2004/02/10 19:03:42 fluxgen Exp $ | 22 | // $Id: XmbFontImp.cc,v 1.8 2004/08/10 11:57:35 fluxgen Exp $ |
23 | 23 | ||
24 | #include "XmbFontImp.hh" | 24 | #include "XmbFontImp.hh" |
25 | 25 | ||
@@ -186,13 +186,6 @@ XFontSet createFontSet(const char *fontname) { | |||
186 | namespace FbTk { | 186 | namespace FbTk { |
187 | 187 | ||
188 | XmbFontImp::XmbFontImp(const char *filename, bool utf8):m_fontset(0), m_utf8mode(utf8) { | 188 | XmbFontImp::XmbFontImp(const char *filename, bool utf8):m_fontset(0), m_utf8mode(utf8) { |
189 | #ifdef DEBUG | ||
190 | #ifdef X_HAVE_UTF8_STRING | ||
191 | cerr<<"Using utf8 = "<<utf8<<endl; | ||
192 | #else // X_HAVE_UTF8_STRING | ||
193 | cerr<<"Using uft8 = false"<<endl; | ||
194 | #endif //X_HAVE_UTF8_STRING | ||
195 | #endif // DEBUG | ||
196 | if (filename != 0) | 189 | if (filename != 0) |
197 | load(filename); | 190 | load(filename); |
198 | } | 191 | } |
@@ -238,18 +231,19 @@ void XmbFontImp::drawText(Drawable w, int screen, GC gc, const char *text, | |||
238 | unsigned int XmbFontImp::textWidth(const char * const text, unsigned int len) const { | 231 | unsigned int XmbFontImp::textWidth(const char * const text, unsigned int len) const { |
239 | if (m_fontset == 0) | 232 | if (m_fontset == 0) |
240 | return 0; | 233 | return 0; |
234 | |||
241 | XRectangle ink, logical; | 235 | XRectangle ink, logical; |
242 | #ifdef X_HAVE_UTF8_STRING | 236 | #ifdef X_HAVE_UTF8_STRING |
243 | if (m_utf8mode) { | 237 | if (m_utf8mode) { |
244 | Xutf8TextExtents(m_fontset, text, len, | 238 | Xutf8TextExtents(m_fontset, text, len, |
245 | &ink, &logical); | 239 | &ink, &logical); |
246 | } else | 240 | if (logical.width != 0) |
241 | return logical.width; | ||
242 | } | ||
247 | #endif // X_HAVE_UTF8_STRING | 243 | #endif // X_HAVE_UTF8_STRING |
248 | { | ||
249 | XmbTextExtents(m_fontset, text, len, | ||
250 | &ink, &logical); | ||
251 | } | ||
252 | 244 | ||
245 | XmbTextExtents(m_fontset, text, len, | ||
246 | &ink, &logical); | ||
253 | return logical.width; | 247 | return logical.width; |
254 | } | 248 | } |
255 | 249 | ||