Some clients of the LayoutEngine would like to be able to tell if a given piece
of text must be processed by the LayoutEngine to be displayed correctly. A
simple way to tell this would be to call layoutEngineFactory() and see if you
get back a concrete instance of LayoutEngine. This will be slow because it
requires creating and then destroying an object.
It would be faster to do this by cloning the logic in layoutEngineFactory() but
not do the object creation. Doing this requires two copies of this logic, which
causes a maintenance problem...
So, the best way to do this is to figure out some way to encapsulate the logic
in layoutEngineFactory in such a way that it can be reused. Or, if we create a
sepreate object for glyph storage, layoutEngineFactory can hand out singleton
instances, and there's no object creation / deletion to deal with.