added text metric caching to improve text drawing performance a bit