Author: matt
Date: 2010-11-15 14:13:13 -0800 (Mon, 15 Nov 2010)
New Revision: 7855
Log:
Fixed handling of missing fonts in Xft (STR #2355)

Modified:
   branches/branch-1.3/CHANGES
   branches/branch-1.3/src/fl_font_xft.cxx

Modified: branches/branch-1.3/CHANGES
===================================================================
--- branches/branch-1.3/CHANGES 2010-11-15 22:09:46 UTC (rev 7854)
+++ branches/branch-1.3/CHANGES 2010-11-15 22:13:13 UTC (rev 7855)
@@ -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)

Modified: branches/branch-1.3/src/fl_font_xft.cxx
===================================================================
--- branches/branch-1.3/src/fl_font_xft.cxx     2010-11-15 22:09:46 UTC (rev 
7854)
+++ branches/branch-1.3/src/fl_font_xft.cxx     2010-11-15 22:13:13 UTC (rev 
7855)
@@ -289,6 +289,20 @@
     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);
 

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to