diff options
Diffstat (limited to 'src/FbTk/XftFontImp.cc')
-rw-r--r-- | src/FbTk/XftFontImp.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/FbTk/XftFontImp.cc b/src/FbTk/XftFontImp.cc index 1d13900..715b130 100644 --- a/src/FbTk/XftFontImp.cc +++ b/src/FbTk/XftFontImp.cc | |||
@@ -33,7 +33,6 @@ namespace FbTk { | |||
33 | 33 | ||
34 | XftFontImp::XftFontImp(const char *name, bool utf8):m_xftfont(0), | 34 | XftFontImp::XftFontImp(const char *name, bool utf8):m_xftfont(0), |
35 | m_utf8mode(utf8) { | 35 | m_utf8mode(utf8) { |
36 | |||
37 | if (name != 0) | 36 | if (name != 0) |
38 | load(name); | 37 | load(name); |
39 | } | 38 | } |
@@ -47,13 +46,14 @@ bool XftFontImp::load(const std::string &name) { | |||
47 | //Note: assumes screen 0 for now, changes on draw if needed | 46 | //Note: assumes screen 0 for now, changes on draw if needed |
48 | 47 | ||
49 | Display *disp = App::instance()->display(); | 48 | Display *disp = App::instance()->display(); |
50 | XftFont *newxftfont = XftFontOpenName(disp, 0, name.c_str()); | ||
51 | 49 | ||
52 | if (newxftfont == 0) { // failed to open font, lets test with XLFD | 50 | XftFont *newxftfont = XftFontOpenXlfd(disp, 0, name.c_str()); |
53 | newxftfont = XftFontOpenXlfd(disp, 0, name.c_str()); | 51 | if (newxftfont == 0) { |
52 | newxftfont = XftFontOpenName(disp, 0, name.c_str()); | ||
54 | if (newxftfont == 0) | 53 | if (newxftfont == 0) |
55 | return false; | 54 | return false; |
56 | } | 55 | } |
56 | |||
57 | // destroy old font and set new | 57 | // destroy old font and set new |
58 | if (m_xftfont != 0) | 58 | if (m_xftfont != 0) |
59 | XftFontClose(disp, m_xftfont); | 59 | XftFontClose(disp, m_xftfont); |