More work on text rendering (untested)