Height measurement for attributed text