From 2efd4b823082efb45cb351c7185d510ccb1dd32a Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Sat, 22 Jun 2013 09:45:48 +0200 Subject: cosmetics --- src/FbTk/Font.cc | 5 +++-- src/FbTk/XftFontImp.cc | 12 +++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/FbTk/Font.cc b/src/FbTk/Font.cc index 544ddc2..c855d10 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 9e57349..86eb9f8 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 } -- cgit v0.11.2