Refactored some glyph-rendering related code. What do we have fast substrings for?