ENH: Better text SDF calculation

This improves the SDF calculation a little bit. Ready for review/merge from my end.
Doesn't matter either way. I just wanted to make sure I wasn't missing something important :)