How to calculate string height/width outside of Paint event