Merge "Slightly more precise RTL check in BoringLayout.isBoring()" into mnc-dev

This commit is contained in:
Raph Levien
2015-07-09 19:56:18 +00:00
committed by Android (Google) Code Review

View File

@@ -269,7 +269,15 @@ public class BoringLayout extends Layout implements TextUtils.EllipsizeCallback
for (int a = 0; a < n; a++) {
char c = temp[a];
if (c == '\n' || c == '\t' || c >= FIRST_RIGHT_TO_LEFT) {
if (c == '\n' || c == '\t' ||
(c >= 0x0590 && c <= 0x08FF) || // RTL scripts
c == 0x200F || // Bidi format character
(c >= 0x202A && c <= 0x202E) || // Bidi format characters
(c >= 0x2066 && c <= 0x2069) || // Bidi format characters
(c >= 0xD800 && c <= 0xDFFF) || // surrogate pairs
(c >= 0xFB1D && c <= 0xFDFF) || // Hebrew and Arabic presentation forms
(c >= 0xFE70 && c <= 0xFEFE) // Arabic presentation forms
) {
boring = false;
break outer;
}