From: John Darrington Date: Fri, 14 Aug 2009 17:32:38 +0000 (+0200) Subject: Revert pango dependency to version 2.20 X-Git-Tag: sid-i386-build98~3 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34cf34e01daa543838eebd89c9879472ef21ac24;p=pspp-builds.git Revert pango dependency to version 2.20 Reduce pango required version to 2.20, and backport the pango_layout_get_baseline function. --- diff --git a/configure.ac b/configure.ac index 5ed6d74f..c9493539 100644 --- a/configure.ac +++ b/configure.ac @@ -51,11 +51,11 @@ AC_ARG_WITH([cairo], [], [with_cairo=yes]) AM_CONDITIONAL([HAVE_CAIRO], [test "$with_cairo" != no]) if test "$with_cairo" != no; then - PKG_CHECK_MODULES([CAIRO], [cairo >= 1.5 pango >= 1.22 pangocairo], + PKG_CHECK_MODULES([CAIRO], [cairo >= 1.5 pango >= 1.20 pangocairo], [CPPFLAGS="$CPPFLAGS $CAIRO_CFLAGS" AC_DEFINE([HAVE_CAIRO], 1, [Define to 1 if Cairo and Pango are available.])], - [PSPP_REQUIRED_PREREQ([cairo 1.5 or later and pango 1.22 or later (or use --without-cairo)])]) + [PSPP_REQUIRED_PREREQ([cairo 1.5 or later and pango 1.20 or later (or use --without-cairo)])]) fi # Support for GUI. diff --git a/src/output/charts/plot-chart.c b/src/output/charts/plot-chart.c index 46884e19..cda6d1ec 100644 --- a/src/output/charts/plot-chart.c +++ b/src/output/charts/plot-chart.c @@ -39,6 +39,26 @@ #include "xalloc.h" +#if ! PANGO_VERSION_CHECK (2, 22, 0) +int pango_layout_get_baseline (PangoLayout *layout); + +/* Shamelessly copied from the pango source */ +int +pango_layout_get_baseline (PangoLayout *layout) +{ + int baseline; + + /* XXX this is so inefficient */ + PangoLayoutIter *iter = pango_layout_get_iter (layout); + baseline = pango_layout_iter_get_baseline (iter); + pango_layout_iter_free (iter); + + return baseline; +} +#endif + + + const struct chart_colour data_colour[N_CHART_COLOURS] = { { 165, 42, 42 }, /* brown */