Merge "Improve TextDirection resolution"