From 61d741a8a9f62f0ebd8317b4e5815627e447cf42 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Mon, 15 Nov 2010 21:35:29 +0000 Subject: [PATCH] Attempt at fixing the XFT problem. Will be testing on Linux shortly. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@7853 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/fl_font_xft.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/fl_font_xft.cxx b/src/fl_font_xft.cxx index e5f317bca..b97f8a24a 100644 --- a/src/fl_font_xft.cxx +++ b/src/fl_font_xft.cxx @@ -212,6 +212,19 @@ static XftFont* fontopen(const char* name, bool core) { XftResult match_result; // the result of our matching attempt // query the system to find a match for this font match_pat = XftFontMatch(fl_display, fl_screen, fnt_pat, &match_result); + if (!match_pat) { + // last chance, just open any font in the right size + the_font = XftFontOpen (fl_display, fl_screen, + XFT_FAMILY, XftTypeString, "sans", + XFT_SIZE, XftTypeDouble, (double)fl_size_, + NULL); + XftPatternDestroy(fnt_pat); + if (!the_font) { + Fl::error("Unable to find fonts. Check your FontConfig configuration.\n"); + exit(1); + } + return the_font; + } // open the matched font the_font = XftFontOpenPattern(fl_display, match_pat); // Tidy up the resources we allocated