summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2010-11-15 22:13:13 +0000
committerMatthias Melcher <fltk@matthiasm.com>2010-11-15 22:13:13 +0000
commitbc1928bbc036ff065000b0655a12e6c24284c12c (patch)
treecea2cbafc3ac371c82cd801a2581c4626b18bd86 /src
parent906549e4f9ff7436a16341c26b569c9195a08f77 (diff)
Fixed handling of missing fonts in Xft (STR #2355)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7855 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/fl_font_xft.cxx14
1 files changed, 14 insertions, 0 deletions
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);