From d43e782fce7543fc352ae567cee1b81d3aa8e8d5 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Sun, 1 Apr 2018 02:00:49 +0200 Subject: [PATCH 1/7] Remove UNSUPPORTED warnings from --with-pango configure option and use Pango by default if it's installed on the system. --- README.md | 2 +- configure.ac | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0fc29bd14..1916fddf6 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Run the following command from the root of the repository: make install -### Optional build options [UNSUPPORTED] +### Optional build options --with-pango diff --git a/configure.ac b/configure.ac index 87f68e3f6..ee18abf35 100644 --- a/configure.ac +++ b/configure.ac @@ -28,8 +28,8 @@ GDIPLUS_CFLAGS="`$PKG_CONFIG --cflags glib-2.0 `" CAIRO_REQUIRED_VERSION="1.6.4" PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_REQUIRED_VERSION) -# Optional use (experimental and unsupported) of Pango's text rendering on top of Cairo -AC_ARG_WITH(pango, [ --with-pango],[text_v=pango],[text_v=cairo]) +# Optional use of Pango's text rendering on top of Cairo +AC_ARG_WITH(pango, [ --with-pango use Pango to measure and draw text],[text_v=pango],[text_v=default]) GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -std=gnu99" @@ -44,12 +44,18 @@ CAIRO_CFLAGS="`pkg-config --cflags cairo `" cairo_info="`pkg-config --modversion cairo ` (system)" GDIPLUS_PKG_REQ="cairo" +PANGO_REQUIRED_VERSION="1.10" +if test $text_v = "pango"; then + PKG_CHECK_MODULES(PANGO, pango >= $PANGO_REQUIRED_VERSION) +fi +if test $text_v = "default"; then + PKG_CHECK_MODULES(PANGO, pango >= $PANGO_REQUIRED_VERSION, + [text_v=pango], [text_v=cairo]) +fi if test $text_v = "pango"; then - PANGO_REQUIRED_VERSION="1.10" - PKG_CHECK_MODULES(PANGO, pango >= $PANGO_REQUIRED_VERSION) PANGO_LIBS="`pkg-config --libs pangocairo `" PANGO_CFLAGS="`pkg-config --cflags pangocairo `" - AC_DEFINE(USE_PANGO_RENDERING,1,[Use Pango to measure and draw text (INCOMPLETE and UNSUPPORTED)]) + AC_DEFINE(USE_PANGO_RENDERING,1,[Use Pango to measure and draw text]) GDIPLUS_PKG_REQ="$GDIPLUS_PKG_REQ pangocairo-1.0" fi From 2452297bd4d303c3b182eb6980f5e19806efdc2e Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Sun, 1 Apr 2018 02:27:53 +0200 Subject: [PATCH 2/7] Add libpango to Travis configuration. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 4d2c872cb..c42be81c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ os: addons: apt: packages: + - libpango1.0-dev - libgif-dev - xvfb - autoconf From b84d8c7bc437bf07597dc5d9ad52947750579dfb Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Sun, 1 Apr 2018 02:38:50 +0200 Subject: [PATCH 3/7] Bump the required Pango version. --- README.md | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1916fddf6..d5d9d88e9 100644 --- a/README.md +++ b/README.md @@ -65,4 +65,4 @@ Run the following command from the root of the repository: --with-pango This builds libgdiplus using Pango to render (measure and draw) - all of it's text. This requires Pango version 1.10 (or later). + all of it's text. This requires Pango version 1.36.8 (or later). diff --git a/configure.ac b/configure.ac index ee18abf35..84d91044c 100644 --- a/configure.ac +++ b/configure.ac @@ -44,7 +44,7 @@ CAIRO_CFLAGS="`pkg-config --cflags cairo `" cairo_info="`pkg-config --modversion cairo ` (system)" GDIPLUS_PKG_REQ="cairo" -PANGO_REQUIRED_VERSION="1.10" +PANGO_REQUIRED_VERSION="1.36.8" if test $text_v = "pango"; then PKG_CHECK_MODULES(PANGO, pango >= $PANGO_REQUIRED_VERSION) fi From 4257ea53712938c9d83684fda112d4f60ef7bfc6 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Sun, 1 Apr 2018 03:24:37 +0200 Subject: [PATCH 4/7] Install Pango from Homebrew on macOS. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c42be81c2..8d42708b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ addons: - git install: -- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; brew install glib cairo libexif; fi +- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; brew install glib cairo pango libexif; fi script: - set -e From 8a76087c093c8c47634b777dfbd5f3437485a3a6 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Sun, 1 Apr 2018 12:35:27 +0200 Subject: [PATCH 5/7] Bump the required Pango version again. The pango_fc_font_map_set_config API was added in 1.37 according to NEWS in the package, but headers declare it as 1.38+. --- README.md | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d5d9d88e9..d8c44e6b6 100644 --- a/README.md +++ b/README.md @@ -65,4 +65,4 @@ Run the following command from the root of the repository: --with-pango This builds libgdiplus using Pango to render (measure and draw) - all of it's text. This requires Pango version 1.36.8 (or later). + all of it's text. This requires Pango version 1.38 (or later). diff --git a/configure.ac b/configure.ac index 84d91044c..d1ebc421a 100644 --- a/configure.ac +++ b/configure.ac @@ -44,7 +44,7 @@ CAIRO_CFLAGS="`pkg-config --cflags cairo `" cairo_info="`pkg-config --modversion cairo ` (system)" GDIPLUS_PKG_REQ="cairo" -PANGO_REQUIRED_VERSION="1.36.8" +PANGO_REQUIRED_VERSION="1.38" if test $text_v = "pango"; then PKG_CHECK_MODULES(PANGO, pango >= $PANGO_REQUIRED_VERSION) fi From 305fd85872770e79950cf1fabe38cfa9432e0bc0 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Sun, 1 Apr 2018 14:23:03 +0200 Subject: [PATCH 6/7] Switch to more updated environment on Travis. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8d42708b9..7a10fb3f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: c -dist: trusty +group: travis_latest sudo: false os: From 4318f43d63748dc0f5127659f48f17907482b8bd Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Wed, 11 Apr 2018 10:46:07 +0200 Subject: [PATCH 7/7] Use Pango font rendering on Windows. --- src/libgdiplus.vcxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libgdiplus.vcxproj b/src/libgdiplus.vcxproj index 147917538..d8a2b5854 100644 --- a/src/libgdiplus.vcxproj +++ b/src/libgdiplus.vcxproj @@ -87,7 +87,7 @@ - HAVE_LIBGIF;HAVE_LIBJPEG;HAVE_LIBTIFF;HAVE_LIBPNG;HAVE_FCFINI;_WINDLL;WIN32;%(PreprocessorDefinitions) + HAVE_LIBGIF;HAVE_LIBJPEG;HAVE_LIBTIFF;HAVE_LIBPNG;HAVE_FCFINI;USE_PANGO_RENDERING;_WINDLL;WIN32;%(PreprocessorDefinitions) Cdecl $(ProjectDir)..\;%(AdditionalIncludeDirectories)