]> git.saurik.com Git - wxWidgets.git/commitdiff
[wxGTK2] Runtime check for pango_font_family_is_monospace in wxFontEnumerator (gtk2...
authorMart Raudsepp <leio@gentoo.org>
Mon, 29 Aug 2005 04:33:15 +0000 (04:33 +0000)
committerMart Raudsepp <leio@gentoo.org>
Mon, 29 Aug 2005 04:33:15 +0000 (04:33 +0000)
applications compiled against gtk2.4 or newer to work with gtk2.2 or older runtime.
Removed HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE configure check in case of wxGTK2, as __WXGTK24__ is now used for that.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35361 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

configure.in
src/unix/fontenum.cpp

index ebe45a959259960f61433a39bce530360a78518f..810b4d84642eb533611c1b87b6c6f7ae5c3e34e3 100644 (file)
@@ -2777,8 +2777,6 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
             CFLAGS="$CFLAGS $wx_cv_cflags_gtk"
             LIBS="$LIBS $wx_cv_libs_gtk"
 
-            AC_CHECK_FUNCS([pango_font_family_is_monospace])
-
             dnl gtk_icon_size_lookup is not available in the GTK+ headers
             dnl that have shipped with some versions of Sun's JDS. Not using
             dnl AC_CHECK_FUNCS here since it only checks the function exists
index 3b9be3e2cb62c030f41c4372b8373ebc6467b954..a577af0357d99ff37e08bcb26207a97ee49415df 100644 (file)
@@ -60,9 +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 )
-    {
+#if defined(__WXGTK20__) || !defined(HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE)
+    if ( fixedWidthOnly
+#if defined(__WXGTK24__)
+        && (gtk_check_version(2,4,0) != NULL)
+#endif
+       )
+{
         OnFacename( wxT("monospace") );
     }
     else
@@ -81,9 +85,13 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
 
         for (int i=0; i<n_families; i++)
         {
-#ifdef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
-            if (!fixedWidthOnly ||
-                pango_font_family_is_monospace(families[i]))
+#if defined(__WXGTK24__) || defined(HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE)
+            if (!fixedWidthOnly || (
+#ifdef __WXGTK24__
+                !gtk_check_version(2,4,0) &&
+#endif
+                pango_font_family_is_monospace(families[i])
+                                   ) )
 #endif
             {
                 const gchar *name = pango_font_family_get_name(families[i]);
@@ -92,7 +100,7 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
         }
         g_free(families);
     }
-    
+
     return TRUE;
 }