Added coordinate calculation functions to text layout.