From 4ae1af0588794ab2b46e376ec20f1b1f6b1715d0 Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Wed, 8 Dec 2004 22:13:37 +0000 Subject: [PATCH] Check for Pango XFT presence (for wxX11). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30907 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- configure | 4 ++++ configure.in | 1 + setup.h.in | 3 +++ src/x11/app.cpp | 6 ++++-- src/x11/dcclient.cpp | 4 +++- src/x11/pango_x.cpp | 2 ++ 6 files changed, 17 insertions(+), 3 deletions(-) diff --git a/configure b/configure index c8d40f1ee2..091a39a8a4 100755 --- a/configure +++ b/configure @@ -25945,6 +25945,10 @@ echo "${ECHO_T}$PANGOXFT_LIBS" >&6 if test $succeeded = yes; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_PANGO_XFT 1 +_ACEOF + CXXFLAGS="$CXXFLAGS $PANGOXFT_CFLAGS" GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOXFT_LIBS" diff --git a/configure.in b/configure.in index 21b278dd98..ae5b076c90 100644 --- a/configure.in +++ b/configure.in @@ -2767,6 +2767,7 @@ equivalent variable and GTK+ is version 1.2.3 or above. ) PKG_CHECK_MODULES(PANGOXFT, pangoxft, [ + AC_DEFINE(HAVE_PANGO_XFT) CXXFLAGS="$CXXFLAGS $PANGOXFT_CFLAGS" GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOXFT_LIBS" ], diff --git a/setup.h.in b/setup.h.in index 895fb518b4..f89f8bfc5e 100644 --- a/setup.h.in +++ b/setup.h.in @@ -1306,6 +1306,9 @@ /* Define if you have pango_font_family_is_monospace() (Pango >= 1.3.3) */ #undef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE +/* Define if you have Pango xft support */ +#undef HAVE_PANGO_XFT + /* ------------------------------------------------------------------------- Win32 adjustments section ------------------------------------------------------------------------- */ diff --git a/src/x11/app.cpp b/src/x11/app.cpp index 5d1ab3726c..5288ac7303 100644 --- a/src/x11/app.cpp +++ b/src/x11/app.cpp @@ -690,7 +690,9 @@ bool wxApp::OnInitGui() #include #include -#include +#ifdef HAVE_PANGO_XFT + #include +#endif PangoContext* wxApp::GetPangoContext() { @@ -700,7 +702,7 @@ PangoContext* wxApp::GetPangoContext() Display *xdisplay = (Display*) wxApp::GetDisplay(); -#if 1 +#ifdef HAVE_PANGO_XFT int xscreen = DefaultScreen(xdisplay); static int use_xft = -1; if (use_xft == -1) diff --git a/src/x11/dcclient.cpp b/src/x11/dcclient.cpp index 286a7018ca..1f7200e9cc 100644 --- a/src/x11/dcclient.cpp +++ b/src/x11/dcclient.cpp @@ -28,7 +28,9 @@ #if wxUSE_UNICODE #include "glib.h" #include "pango/pangox.h" -#include "pango/pangoxft.h" +#ifdef HAVE_PANGO_XFT + #include "pango/pangoxft.h" +#endif #include "pango_x.cpp" #endif diff --git a/src/x11/pango_x.cpp b/src/x11/pango_x.cpp index 49393ad53e..405514c43a 100644 --- a/src/x11/pango_x.cpp +++ b/src/x11/pango_x.cpp @@ -64,6 +64,7 @@ x11_draw_glyphs( Drawable drawable, PangoGlyphString *glyphs, wxColour &colour ) { +#ifdef HAVE_PANGO_XFT if (PANGO_XFT_IS_FONT (font)) { Display* xdisplay = wxGlobalDisplay(); @@ -84,6 +85,7 @@ x11_draw_glyphs( Drawable drawable, XftDrawDestroy( draw ); } else +#endif { pango_x_render( wxGlobalDisplay(), drawable, gc, font, glyphs, x, y ); } -- 2.45.2