Refactor typeface caching to a separate class.