shoes/shoes4 — pull request #812 by jasonrclark (2014-07-27 07:07:09+00:00)
Title: Reuse in font factory (builds off #802)

This PR builds off of #802 (since it was on a fork was easier to just PR separately... will close out both PR's when this is merged).

@georgewalton did some great work getting us to reuse fonts during text fitting. This solved a problem he encountered when running some apps on Windows where the font handles seem to be more limited in number.

I've added a number of commits on top of his work. These do a couple of things:

* Add specs for the `TextFontFactory` class which didn't exist before (my bad :blush:)
* Make changes so `TextFont` class @georgewalton added was more idiomatic Ruby
* Realized that we could get the necessary data to compare for existing fonts directly from the SWT objects, so updated to just do that in the factory instead of holding our own separate objects for it.

The result here passes specs and runs the normal samples I check when dealing with text.

@georgewalton, could you give this a whirl on your Windows machine and double-check that I haven't lost the actual bug fix in the shuffle (running OS X here, so I can't easily dup the handle exhaustion).

:metal: