]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/fontenum.cpp
added setup.h file containing the settings common to all ports and a script to update...
[wxWidgets.git] / src / unix / fontenum.cpp
index 869a546f3923991afaa5a5bef2f99ad46c45bf4e..4ba3e6512d8da4a2903d58064218a170c1ab41b9 100644 (file)
@@ -32,6 +32,7 @@
 #include "wx/fontmap.h"
 #include "wx/fontenum.h"
 #include "wx/fontutil.h"
+#include "wx/encinfo.h"
 
 // ----------------------------------------------------------------------------
 // Pango
@@ -59,11 +60,13 @@ cmp_families (const void *a, const void *b)
 bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
                                           bool fixedWidthOnly)
 {
+#ifndef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
     if ( fixedWidthOnly )
     {
         OnFacename( wxT("monospace") );
     }
     else
+#endif
     {
         PangoFontFamily **families = NULL;
         gint n_families = 0;
@@ -78,10 +81,14 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
 
         for (int i=0; i<n_families; i++)
         {
-            const gchar *name = pango_font_family_get_name( families[i] );
-            
-            wxString tmp( name, wxConvUTF8 );
-            OnFacename( tmp );
+#ifdef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
+            if (!fixedWidthOnly ||
+                pango_font_family_is_monospace(families[i]))
+#endif
+            {
+                const gchar *name = pango_font_family_get_name(families[i]);
+                OnFacename(wxString(name, wxConvUTF8));
+            }
         }
     }