Refactoring TextBlockPainter to make links easier

The existing TextBlockPainter logic assumed that we only had a single
underlying text layout object to interact with. As such, methods treated
styling as one operation when some apply to all layouts equally, others to only
one of the layouts at a time.

This changeset splits those apart so the defaulting of styles across both
layouts happens in one set of methods, changes that are specific to a given
layout in others.

There was also some renaming to make better sense of what's happening. Names
were a bit generic--coming in it wasn't clear why set_font_styles was different
from set_text_styles, but they are actually dramatically different things. The
new names hopefully convey that more clearly.
Adding class for collection of fitted text layouts

We'll start treating them as a group for any operations (styling, cursor and
link positioning) that will require spanning across the multiple separate text
layout segments.

This commit attempts to just add/extract some of the basic classes, but doesn't
start putting them into use in the main painter classes yet.
Apply default styles to text blocks via collection

This moves over the main drawing call and default styling application to the
FittedTextLayoutCollection.
Apply styling to segments within layout collection

This first commit moves towards applying segment styling (from sub-spans, links,
etc) when working against multiple layouts. This isn't wired in yet, doesn't
do actual styling, but gets the iteration in place properly for selecting
the ranges and layouts to work against.
Merge styles together on segment before applying

A range can potentially have multiple styles applied to it, so apply all of
them starting from the default style before actually setting the style.
Start using layout collection for styling ranges

This is only partially functional, but will apply basic styling from Span
elements onto sub-ranges of a text-block while properly heeding the splits of
different layouts.

Leaving old version of this code (TextBlockPainter#set_styles_from_segments)
for reference as implementation of all its functionality continues.
Gating merging styles on segment having opts

If we get something other than a Span (or later a Link) then the gathering on
the styles wont have #opts to call against. In this case just skip over it and
apply any other segment styling we can find in the list.

This replaces the class-specific check for Shoes::Span and is a little more
general to the same effect. We will probably still need a class-specific check
for the link styling, but haven't looked deeply at that yet.
Apply styling to links

Will make clickable later on with separate class.
Split lines to make specs more readable
Merge branch 'master' into links_across_layouts

Conflicts:
	lib/shoes/swt/text_block_painter.rb
	spec/swt_shoes/text_block_painter_spec.rb
Merge branch 'links_across_layouts' of github.com:jasonrclark/shoes4 into jasonrclark-links_across_layouts
Moved a little way towards a working spec again for font size adjustments
Merge pull request #3 from PragTob/jasonrclark-links_across_layouts

Merge with master + a stab at the failing test
Revisions from review

* Access blue color via standard method rather than extend self on Shoes::DSL
* Adding constants
* Use default parameter on set_style instead of ||= in method body
* TextFontFactory.create_font now takes style hash instead of individual values
* Removing unnecessary require
* Better naming for range determining method in FittedTextLayout
* Clearer name for the left/top methods on FittedTextLayout
Fix regression with font styles

This was already fixed with https://github.com/shoes/shoes4/commit/0f6ba294
but that got lost in the merging shuffle.

This also puts a closer test and check around what was fouling up the
TextBlockPainter test on the styling. The root cause was disagreement between
the stubbing length and text, which ended up returning odd results (different
ranges in the same single layout). We now test for and treat that more sanely.
Refactoring layout_ranges method

This method was getting a little long and hard to read, so I've broken the
various cases down into their own named sub-methods for setting each specific
case of range + layout combination up.
Options for Link, consolidate with Span

The eventual goal is to have Link just be a slight special case of a Span, but
this is only the first step toward getting there.
Renaming variables to better align with what's passed
Make LinkSegments from FittedTextLayoutCollection

We need a better home for a lot of the link creation code, and it gets even
more complicated with the addition of splits across layouts. Time for a new
class!

Shoes::Swt::LinkSegment which is only stubbed out for now, will be responsible
for estabishing the actual clickable SWT regions that we care about for a link.
A list of these will be tracked on the DSL Link class, although they'll be of
limited use in most cases.

This commit wires up the necessary method in the FittedTextLayoutCollection for
creating these links based on the ranges we've got, with the hard work of
making something actually clickable put off to another commit.
Clear LinkSegments when repainting

Each time we recreate the LinkSegments for a TextBlock, make sure to clear out
the existing segments so we don't leak them.