more minor work on refactoring text rendering

a few tiny bug fixes (should switch to master?)