cairo: don't render text when text matrix is not invertable

Emulates acroread behavior.

Bug 78042
cairo: Only embed mime data for gray/rgb/cmyk colorspaces

Bug 80719
cairo: only embed mime data if image decode map is identity

https://bugs.launchpad.net/ubuntu/+source/cairo/+bug/1317517
Make Attribute::getName() work when UTF-16BE is used

Contains some ideas by me
Bug #84722
Fix memory leak in Dict.remove.

The entry was previously just overwritten now it is freed

Small fixes by Albert oo

Bug #84607
cairo: fix crash when no group color space

Bug 85137
pdfdetach: fix crash when getPage() returns null

Bug 85145
PDFDOC: Check for EOF when reading raw stream

Bug 85233
PDFDoc: fix crash when getPage() returns NULL

Bug 85235
Add support for printing to a Windows printer from pdftocairo

Bug 79936
pdftocairo: Allow an output file for win32 printing to be specified

Can be used for testing win32 print output without wasting paper.
make pdftocairo-win32.cc a standalone .cc file

instead of #including it in pdftocairo.cc
pdftocairo: fix a number of bugs in win32 printing

- make origPageSizes work
- make landscape pages work
- make -noshrink option work
- return actual page size in use back to main() so fit page transform works
- hdc should be destroyed after cairo surface
- improve option parsing and rename duplex values
- Add third call to DocumentProperties as discussed in bug 79936
- fix error messages
pdftocairo: add a -setupdlg option that will the show printer properties

dialog when printing to a win32 printer.
pdftocairo: add -printdlg output option for win32

when set the win32 print dialog is displayed before printing
fofi: Fix a crash when parsing an invalid font due to a integer overflow

This fixes a crash rendering trust_metrics.f2495.f0.pdf.
Fix warning on unused variable in pdftocairo.cc

Fixes warning:

  CXX      pdftocairo-pdftocairo.o
pdftocairo.cc:130:14: warning: ‘setupdlg’ defined but not used [-Wunused-variable]
 static GBool setupdlg = gFalse;
              ^

https://bugs.freedesktop.org/show_bug.cgi?id=85400
regtest: Allow to run groups of tests individually

Now it's possible to pass more than one argument to run-tests command and
optionally the docs directory. When more than one test is passed and the
docs directory is not provided, the common base path of all passed tests
is used as docs directory. The tests passed can be documents or
directories, using absolute paths or paths relative to the docs
directory.
This also allows us to update the refs for a group of tests.
regtest: Limit the number of worker threads to the number of documents to test

We are always spawning all the threads even if the documents to test is
less than the worker threads. Also optimize the case of running only one
test to not spwn any thread.
regtest: Fix png diff generation with python-pil pillow fork

Use from PIL import Image instead of just import Image, since pillow
only doesn't support import Image without using PIL.Image.