Simplified the renderText functions code and made them support Unicode text again.