From 4d67b9d3d76b94a898a95a9e4e73d91489047b5e Mon Sep 17 00:00:00 2001 From: fluxgen Date: Wed, 16 Oct 2002 23:56:13 +0000 Subject: try XLFD if load failes --- src/XftFontImp.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/XftFontImp.cc b/src/XftFontImp.cc index 619b791..f3da167 100644 --- a/src/XftFontImp.cc +++ b/src/XftFontImp.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -//$Id: XftFontImp.cc,v 1.2 2002/10/16 23:13:15 fluxgen Exp $ +//$Id: XftFontImp.cc,v 1.3 2002/10/16 23:56:13 fluxgen Exp $ #include "XftFontImp.hh" #include "BaseDisplay.hh" @@ -41,9 +41,11 @@ bool XftFontImp::load(const std::string &name) { Display *disp = BaseDisplay::getXDisplay(); XftFont *newxftfont = XftFontOpenName(disp, 0, name.c_str()); - if (newxftfont == 0) // failed to open font, use old fon - return false; - + if (newxftfont == 0) { // failed to open font, lets test with XLFD + newxftfont = XftFontOpenXlfd(disp, 0, name.c_str()); + if (newxftfont == 0) + return false; + } // destroy old font and set new if (m_xftfont != 0) XftFontClose(disp, m_xftfont); -- cgit v0.11.2