From 2696b11cd5b7fe3550f76647e44252d767876ce5 Mon Sep 17 00:00:00 2001 From: Mart Raudsepp Date: Mon, 29 Aug 2005 04:33:15 +0000 Subject: [PATCH] [wxGTK2] Runtime check for pango_font_family_is_monospace in wxFontEnumerator (gtk2.4 runtime check) to allow wxGTK2 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 | 2 -- src/unix/fontenum.cpp | 22 +++++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/configure.in b/configure.in index ebe45a9592..810b4d8464 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/src/unix/fontenum.cpp b/src/unix/fontenum.cpp index 3b9be3e2cb..a577af0357 100644 --- a/src/unix/fontenum.cpp +++ b/src/unix/fontenum.cpp @@ -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