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)
Bug 651949 - Don't crash on save in non-browse mode

Not getting a filename looks like a contract violation in Gtk+ to me.
Still Dia would be crashing, instead simply go back to the dialog.

(cherry picked from commit cfc6810939d8fce9e17b306f4c72b58427b98a70)
Bug 710818 - Overflow safe wrappers for acos/asin

acos() and asin() are only defined in a certain range. Implement some
range/overflow safe wrappers rather than potentially passing infinite
to other modules (e.g. cairo did assert() on it.)

(cherry picked from commit 846a7ff5b5cb5d21f3c97d21f7a1890a0fcfb65b)

Conflicts:
	lib/boundingbox.c
	lib/geometry.c
Bug 711418 - Handle diagram file with comments

A comment as the first part in the XML file was prohibiting to load
the file at all with “Not a Dia file” error.

(cherry picked from commit 805905eae28f215c74716c1fef684106a9997c54)
plugin: Use the Freetype developer's proposed way if #include'ing their headers.

Allows us to build against Freetype 2.5.1 (without breaking older
versions).

https://bugzilla.gnome.org/show_bug.cgi?id=720573

Signed-off-by: Hans Breuer <hans@breuer.org>
(cherry picked from commit 0b863adcad031c70601e375d72dae64fdd967752)
Update NEWS for Dia 0.97.3 bug-fix-only