In that commit I leave calculation as is. FriBiDi wrapped needs more rework and fixes.