Bug 573261 - Avoid font kerning problems with pangocairo(fc)

There is a recurring bug with pangocairo related to kerning and font scaling.
See: https://bugzilla.gnome.org/buglist.cgi?quicksearch=341481+573261+700592
Rather than waiting for another fix let's try to implement the ultimate work
around. With Pango-1.32 and HarfBuzz the kludge in Pango is gone and apparently
substituted with a precision problem. If we now use huge fonts when talking
to Pango and downscale these with cairo it should work with all Pango versions.

Also add a sequence diagram used to understand the problem.

(cherry picked from commit 226fb87f34d4b49e700fb9cb340b49b67fd59540)
Use python-config where available

In the next Ubuntu release, python will be installed with multiarch support,
which breaks the build because assumptions are made about python library
locations which no longer hold true.

python-config has been supported in upstream Python since 2.6, so use
python-config to determine include file and library locations and names if it
is available. Otherwise fall back to the old behaviour.

This fixes the build in the current development release of Ubuntu, and is a
reasonably generic and cross-platform way to configure the build for Python.

Signed-off-by: Hans Breuer <hans@breuer.org>
(cherry picked from commit c66f9543c41008ccc2f093b744da6893c2cb91e9)
Bug 651127 - Correctly detect swig 2.x

Patch from ismail@namtrac.org

(cherry picked from commit fb277f11d744c9724475babc6388489437faa5e6)
Bug 721851 - Command line export not working for pixbuf

The pixbuf export requires a diaplay. Use gtk_init_check() to
allow command line export from an X terminal without sacrificing
the command line mode without X11.

(cherry picked from commit c3dcf1eec1b4ef57c45c58410048b77c83ea50dd)