diff --git a/src/FbTk/Font.cc b/src/FbTk/Font.cc index 544ddc23..c855d10e 100644 --- a/src/FbTk/Font.cc +++ b/src/FbTk/Font.cc @@ -91,10 +91,11 @@ typedef FontCache::iterator FontCacheIt; void resetEffects(FbTk::Font& font) { + int nr_scr = DefaultScreen(FbTk::App::instance()->display()); font.setHalo(false); - font.setHaloColor(FbTk::Color("white", DefaultScreen(FbTk::App::instance()->display()))); + font.setHaloColor(FbTk::Color("white", nr_scr)); font.setShadow(false); - font.setShadowColor(FbTk::Color("black", DefaultScreen(FbTk::App::instance()->display()))); + font.setShadowColor(FbTk::Color("black", nr_scr)); font.setShadowOffY(2); font.setShadowOffX(2); } diff --git a/src/FbTk/XftFontImp.cc b/src/FbTk/XftFontImp.cc index 9e57349f..86eb9f8c 100644 --- a/src/FbTk/XftFontImp.cc +++ b/src/FbTk/XftFontImp.cc @@ -62,12 +62,12 @@ bool XftFontImp::load(const std::string &name) { if (newxftfont == 0) return false; } - + // destroy all old fonts and set new for (int r = ROT0; r <= ROT270; r++) { m_xftfonts_loaded[r] = false; if (m_xftfonts[r] != 0) { - XftFontClose(App::instance()->display(), m_xftfonts[r]); + XftFontClose(disp, m_xftfonts[r]); m_xftfonts[r] = 0; } } @@ -176,12 +176,10 @@ unsigned int XftFontImp::textWidth(const char* text, unsigned int len) const { #ifdef HAVE_XFT_UTF8_STRING if (m_utf8mode) { - XftTextExtentsUtf8(disp, - font, - (XftChar8 *)text, len, - &ginfo); - if (ginfo.xOff != 0) + XftTextExtentsUtf8(disp, font, (XftChar8 *)text, len, &ginfo); + if (ginfo.xOff != 0) { return ginfo.xOff; + } // the utf8 failed, try normal extents }