font rendering code mostly cleaned up