Add GetConstrainedFontSize to FTTools and MTUtilities.

Add a method to compute the font size needed to make text rendered
by FreeTypeTools or MathTextUtilities fill a specified rectangle.
The documentation of vtkTextMapper::GetConstrainedFontSize is
clarified, too.

Change-Id: I39de26b5173153eaec9e8f5f2857fe9964bad768

s constrained -- add note about updated docs for tmapper

Change-Id: Ib8c042285aabc719fe57825c05d85b6ab2b59c4b
Add multiline, justification, and shadows to vtkFreeTypeTools.

Also, explicitly return text dimensions from text rasterization
functions. Older hardware requires texture image dimensions to be
powers of 2. Since the text will only be rendered into a portion of
the image in these cases, the text dimensions are needed to calculate
the texture coordinates during rendering.

Some classes were hiding the text dimensions in the image metadata, e.g.
texture coordinates and text dimensions were stored in Spacing and Origin.
This undocumented behavior was confusing and unintuitive.

Now functions that rendering scaled images explicitly return the text
dimensions.

Change-Id: Ic74b0dd9573d336427038985c671a8b724c92429
Clean up comments, style in FreeTypeTools.

Change-Id: I9e020c0d7e19294762f8fb270dccc7e42a49f748
Add a TextRenderer interface and implementation.

An abstract vtkTextRenderer interface is added to RenderingCore.
This will allow all rendering classes to have access to text rendering
functionality without an explicit dependence on RenderingFreeType. Once
existing code is migrated to use this simplified interface, applications
using VTK will be able to add their own text rendering backends easily.

The interface is designed to, at minimum, switch between FreeType and
MathText rendering, enabling any users of the interface to have access
to pretty-printed equation by passing in MathText markup, which is a subset
of LaTeX. The implementation will test for the presence of "$...$" in the
input string and, if present, MathText will be used instead of FreeType.
If MathText is unavailable (it requires python and matplotlib) or fails
to render, a warning is produced and the FreeType backend is used as a
fallback.

The default implementation of this class is vtkMathTextFreeTypeTextRenderer
in the RenderingFreeType module.

Change-Id: I215ad856e3f197c3ea22eb8f9dd68e5ec2f9e620
Port vtkTextActor to use vtkTextRenderer.

The MathTextActor is updated too, since it used the FTUtilities class
cached by TextActor. I plan to remove the MathTextActor classes completely,
since their functionality is redundant once TextActors are using
TextRenderer.

Change-Id: I098a02ac5e55c1ce31423c1268fb4db2e2b5bb1f
Add simple benchmark to test new text rendering classes.

The benchmark is in Rendering/FreeType/Testing/Cxx, and is disabled
by default since it takes a little while to run and will never actually
fail.

The benchmark compares the new FTTools implementation to FTUtilities,
which was previously the only way to render multi-line text. A variety
of font sizes, orientations, etc are used in order to force cache misses
in the FreeType cache. The test string is unusually long for VTK (500
lines), but this was necessary to ensure that each render occurred on a
measurable timescale. vtkTextRenderer is also tested to benchmark the
overhead that the TextRenderer layer adds.

On my machine in a release-mode build, I get:

FTTools: Total: 23.06  Min: 0.00  Max: 1.29  Ave: 0.23
TextRen: Total: 22.94  Min: 0.00  Max: 1.28  Ave: 0.22
FTUtils: Total: 27.00  Min: 0.01  Max: 1.48  Ave: 0.27

So some of the renderings in the new class are still occurring faster
than clock() can detect, but there is nevertheless an improvement
over FTUtils. It would be useful to figure out a way to benchmark small
strings of 1-5 lines in a reasonable way.

Change-Id: I8f37e3130ed766932f671f315ce790d1772e2410
Fix failing TestCaptionActor.

The text drop shadow was colored the same as the text, creating a very
difficult to read label. This patch resets the color property of the
caption's text actor to the default vtkProperty2D color.

Change-Id: Id00640dca2fc97ef81011feec5be4993116e3217
Cleanup vtkTextRenderer documentation and overloads.

Change-Id: I97463a1271e84d86cb8c5a64ca8d74ff20a971bb
Merge topic 'TextRenderer' into master

75e3726f Cleanup vtkTextRenderer documentation and overloads.
ef48d154 Fix failing TestCaptionActor.
c3f33573 Add simple benchmark to test new text rendering classes.
d17c39aa Port vtkTextActor to use vtkTextRenderer.
f393fa8b Add a TextRenderer interface and implementation.
e5e484be Clean up comments, style in FreeTypeTools.
6dd7b574 Add multiline, justification, and shadows to vtkFreeTypeTools.
5c14d896 Add GetConstrainedFontSize to FTTools and MTUtilities.