Fix broken pdf_write functionality.

Since I implemented linearisation, any invocation that hasn't used
garbage collection has produced broken files, due to every object
being marked as freed. This was because I'd forgotten to ever set
the use_list markers to be 1. Fixed here.
Fix missing diagram in 1522*.pdf

Since the commit to replace abs/min/max/clamp with inline versions,
"1522 - diagramm missing above 88 pc zoom.pdf" has been missing a
diagram. This is because the diagram contains sections like:

 -2147483648 -2147483648 m
 -2147483648 2147483647 l
  2147483647 2147483647 l
  2147483647 -2147483648 l

These extreme values, when transformed would give floating point values
that when naively cast down to int, flip sign (e.g. extreme positive
when cast to int becomes extreme negative).

I had been relying on the cast down giving sane results to enable me to
use fz_clampi. Revert to using fz_clamp and all is fine.
Remove pointless test.

Variable i can never be zero at this point. The desired point of testing
against i was to ensure that the test did not evaluate true at the
first run, and the other parts of the condition are sufficent to
ensure this, so just remove the test on i.
Attempt to load CID fonts with invalid cid collections.

Warn instead of throwing an error. Fixes file in
http://code.google.com/p/sumatrapdf/issues/detail?id=1842
Pass original font name to fz_new_font from PDF interpreter.

Improves text device output when using substitute fonts.
Fixes bug #693019.
Prefer the more specific name if BaseName and FontName differ.

Also strip the subset prefix.
Give precedence to /Subtype field when deciding on font encodings.

Fixes bug where Symbol is not embedded but encoded as a TrueType but the
built-in font is a Type1.

http://code.google.com/p/sumatrapdf/issues/detail?id=1310
Use FT_ENCODING_MS_SYMBOL encoding for symbolic TrueType fonts.

Fixes http://code.google.com/p/sumatrapdf/issues/detail?id=1815
Don't encode MS-Symbol encoded fonts by glyph names.

Fix bug http://code.google.com/p/sumatrapdf/issues/detail?id=1618
Only warn if ToUnicode CMap cannot be loaded.
Tweak some font encoding heuristics.

Always use BaseFont, always ignore font descriptor's FontName.
Fallback case for type 1 fonts without encoding and non-standard glyph names.

Fixes bug #692289
Prefer larger Width value if more than one is given for each glyph.

Fixes bug #692267
Fix encryption key length check

Encryption keys lengths are expressed in bits, however
one check assumed the length was expressed in bytes.
Whitespace fixes in code for pdf functions.
Remove redundant check in pdf function code

BitsPerSample is already screened later in the code for invalid
values, including the default value 0 returned by pdf_to_int().
Clamp number of pdf function inputs/outputs

Previously a pdf function having too many inputs or outputs would
cause and exception, now they will be handled silently.

There are two places pdf functions are used: for shadings and for
colorspace tint transforms. In both cases the number of inputs/outputs
may never be more than the number of components, i.e. limited to MAXN.
Additionally the number of inputs/outputs may never be less than than
the number of components, and there is always at least one component.
Provide number of inputs/outpus when loading pdf functions

This will allow the loading of pdf functions to validate that a pdf
function has the correct number of inputs/outputs. Additionally it
will allow for handling pdf functions with incorrect number of
inputs/outputs.
Handle pdf functions with too many inputs

Both exponential and stitching functions are limited to having one
input. Make sure that any excessive inputs are ignored.
Handle pdf function evaluation with wrong number of inputs/outputs

Functions requiring more inputs than available input values will have
those inputs set to zero. Similarly functions producing too few
outputs will have the remaining output values be set to zero. Any
excessive input values or output values will be ignored.