Implement 'Phags-pa shaping
authorBehdad Esfahbod <behdad@behdad.org>
Fri, 2 Nov 2012 03:05:04 +0000 (20:05 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Fri, 2 Nov 2012 03:05:04 +0000 (20:05 -0700)
Through the Arabic shaper.  It's similar to Mongolian.

src/hb-ot-shape-complex-arabic.cc
src/hb-ot-shape-complex-private.hh

index 8428534..bacee5d 100644 (file)
@@ -64,15 +64,24 @@ static unsigned int get_joining_type (hb_codepoint_t u, hb_unicode_general_categ
       return j_type;
   }
 
-  /* Mongolian joining data is not in ArabicJoining.txt yet */
+  /* Mongolian joining data is not in ArabicJoining.txt yet. */
   if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x1800, 0x18AF)))
   {
     /* All letters, SIBE SYLLABLE BOUNDARY MARKER, and NIRUGU are D */
-    if (gen_cat == HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER || u == 0x1807 || u == 0x180A)
+    if ((FLAG(gen_cat) & (FLAG (HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER) |
+                         FLAG (HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER)))
+       || u == 0x1807 || u == 0x180A)
       return JOINING_TYPE_D;
   }
 
-  if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x200C, 0x200D))) {
+  /* 'Phags-pa joining data is not in ArabicJoining.txt yet. */
+  if (unlikely (hb_in_range<hb_codepoint_t> (u, 0xA840, 0xA872)))
+  {
+      return JOINING_TYPE_D;
+  }
+
+  if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x200C, 0x200D)))
+  {
     return u == 0x200C ? JOINING_TYPE_U : JOINING_TYPE_C;
   }
 
index e84c490..065264e 100644 (file)
@@ -130,6 +130,7 @@ hb_ot_shape_complex_categorize (const hb_segment_properties_t *props)
 
     /* Unicode-5.0 additions */
     case HB_SCRIPT_NKO:
+    case HB_SCRIPT_PHAGS_PA:
 
     /* Unicode-6.0 additions */
     case HB_SCRIPT_MANDAIC:
@@ -199,9 +200,6 @@ hb_ot_shape_complex_categorize (const hb_segment_properties_t *props)
     /* Unicode-4.1 additions */
     case HB_SCRIPT_SYLOTI_NAGRI:
 
-    /* Unicode-5.0 additions */
-    case HB_SCRIPT_PHAGS_PA:
-
     /* Unicode-5.1 additions */
     case HB_SCRIPT_KAYAH_LI: