Function computeBoundTextPosition