more text input fixes and text draw code cleanup
merge