summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES1
-rw-r--r--src/fl_font_xft.cxx14
2 files changed, 15 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index b7c11502b..15991cf9d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,6 @@
CHANGES IN FLTK 1.3.0
+ - Fixed handling of missing fonts in Xft (STR #2355)
- Added alternative Xft font names (STR #2215)
- Update lib png access (STR #2442)
- Fixed OpenGL hide/show issue in OS X (STR #2260)
diff --git a/src/fl_font_xft.cxx b/src/fl_font_xft.cxx
index 01b5c2bc4..7124b04c6 100644
--- a/src/fl_font_xft.cxx
+++ b/src/fl_font_xft.cxx
@@ -289,6 +289,20 @@ static XftFont* fontopen(const char* name, bool core, int angle) {
free(picked_name);
#endif
+ 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);