fix text bounds calculation