[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
This commit is contained in:
@@ -2777,8 +2777,6 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
|
|||||||
CFLAGS="$CFLAGS $wx_cv_cflags_gtk"
|
CFLAGS="$CFLAGS $wx_cv_cflags_gtk"
|
||||||
LIBS="$LIBS $wx_cv_libs_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 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 that have shipped with some versions of Sun's JDS. Not using
|
||||||
dnl AC_CHECK_FUNCS here since it only checks the function exists
|
dnl AC_CHECK_FUNCS here since it only checks the function exists
|
||||||
|
@@ -60,9 +60,13 @@ cmp_families (const void *a, const void *b)
|
|||||||
bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
|
bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
|
||||||
bool fixedWidthOnly)
|
bool fixedWidthOnly)
|
||||||
{
|
{
|
||||||
#ifndef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
|
#if defined(__WXGTK20__) || !defined(HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE)
|
||||||
if ( fixedWidthOnly )
|
if ( fixedWidthOnly
|
||||||
{
|
#if defined(__WXGTK24__)
|
||||||
|
&& (gtk_check_version(2,4,0) != NULL)
|
||||||
|
#endif
|
||||||
|
)
|
||||||
|
{
|
||||||
OnFacename( wxT("monospace") );
|
OnFacename( wxT("monospace") );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -81,9 +85,13 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
|
|||||||
|
|
||||||
for (int i=0; i<n_families; i++)
|
for (int i=0; i<n_families; i++)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
|
#if defined(__WXGTK24__) || defined(HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE)
|
||||||
if (!fixedWidthOnly ||
|
if (!fixedWidthOnly || (
|
||||||
pango_font_family_is_monospace(families[i]))
|
#ifdef __WXGTK24__
|
||||||
|
!gtk_check_version(2,4,0) &&
|
||||||
|
#endif
|
||||||
|
pango_font_family_is_monospace(families[i])
|
||||||
|
) )
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
const gchar *name = pango_font_family_get_name(families[i]);
|
const gchar *name = pango_font_family_get_name(families[i]);
|
||||||
|
Reference in New Issue
Block a user