Break layout context before and after bidi control character

Bug: 170968514
Test: minikin_test
Change-Id: Ibcff6f3b7fcb7fefa2acb7f52446cf4b4547a4a2
Merged-In: Ibcff6f3b7fcb7fefa2acb7f52446cf4b4547a4a2
diff --git a/libs/minikin/LayoutUtils.cpp b/libs/minikin/LayoutUtils.cpp
index a3238d4..8f132c8 100644
--- a/libs/minikin/LayoutUtils.cpp
+++ b/libs/minikin/LayoutUtils.cpp
@@ -39,6 +39,11 @@
         // spaces
         return true;
     }
+    // Break layout context before and after BiDi control character.
+    if ((0x2066 <= c && c <= 0x2069) || (0x202A <= c && c <= 0x202E) || c == 0x200E ||
+        c == 0x200F) {
+        return true;
+    }
     // Note: kana is not included, as sophisticated fonts may kern kana
     return false;
 }