Fill out combining class resetting for fallback shaping Thai/Lao/Tibetan
authorBehdad Esfahbod <behdad@behdad.org>
Fri, 10 Aug 2012 01:12:30 +0000 (21:12 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Fri, 10 Aug 2012 01:14:23 +0000 (21:14 -0400)
src/hb-ot-shape-fallback.cc
src/hb-unicode-private.hh
src/hb-unicode.cc

index 71aed89..abc7e2b 100644 (file)
@@ -49,7 +49,9 @@ recategorize_combining_class (unsigned int modified_combining_class)
    * from hb-unicode.cc. */
   switch (modified_combining_class)
   {
+
     /* Hebrew */
+
     case HB_MODIFIED_COMBINING_CLASS_CCC10: /* sheva */
     case HB_MODIFIED_COMBINING_CLASS_CCC11: /* hataf segol */
     case HB_MODIFIED_COMBINING_CLASS_CCC12: /* hataf patah */
@@ -79,7 +81,9 @@ recategorize_combining_class (unsigned int modified_combining_class)
     case HB_MODIFIED_COMBINING_CLASS_CCC21: /* dagesh */
       break;
 
+
     /* Arabic and Syriac */
+
     case HB_MODIFIED_COMBINING_CLASS_CCC27: /* fathatan */
     case HB_MODIFIED_COMBINING_CLASS_CCC28: /* dammatan */
     case HB_MODIFIED_COMBINING_CLASS_CCC30: /* fatha */
@@ -94,7 +98,39 @@ recategorize_combining_class (unsigned int modified_combining_class)
     case HB_MODIFIED_COMBINING_CLASS_CCC32: /* kasra */
       return HB_UNICODE_COMBINING_CLASS_BELOW;
 
-    /* TODO Thai, Lao, and Tibetan */
+
+    /* Thai */
+
+    /* Note: to be useful we also need to position U+0E3A that has ccc=9 (virama).
+     * But viramas can be both above and below based on the codepoint / script. */
+
+    case HB_MODIFIED_COMBINING_CLASS_CCC103: /* sara u / sara uu */
+      return HB_UNICODE_COMBINING_CLASS_BELOW;
+
+    case HB_MODIFIED_COMBINING_CLASS_CCC107: /* mai */
+      return HB_UNICODE_COMBINING_CLASS_ABOVE;
+
+
+    /* Lao */
+
+    case HB_MODIFIED_COMBINING_CLASS_CCC118: /* sign u / sign uu */
+      return HB_UNICODE_COMBINING_CLASS_BELOW;
+
+    case HB_MODIFIED_COMBINING_CLASS_CCC122: /* mai */
+      return HB_UNICODE_COMBINING_CLASS_ABOVE;
+
+
+    /* Tibetan */
+
+    case HB_MODIFIED_COMBINING_CLASS_CCC129: /* sign aa */
+      return HB_UNICODE_COMBINING_CLASS_BELOW;
+
+    case HB_MODIFIED_COMBINING_CLASS_CCC130: /* sign i*/
+      return HB_UNICODE_COMBINING_CLASS_ABOVE;
+
+    case HB_MODIFIED_COMBINING_CLASS_CCC132: /* sign u */
+      return HB_UNICODE_COMBINING_CLASS_BELOW;
+
   }
 
   return modified_combining_class;
index b2af7c8..53214b9 100644 (file)
@@ -260,8 +260,9 @@ extern HB_INTERNAL const hb_unicode_funcs_t _hb_unicode_funcs_nil;
 
 /* Thai
  *
- * Modify U+0E38 and U+0E39 (ccc=104) to be reordered before U+0E3A (ccc=9).
- * Uniscribe does this too.
+ * Modify U+0E38 and U+0E39 (ccc=103) to be reordered before U+0E3A (ccc=9).
+ * Assign 3, which is unassigned otherwise.
+ * Uniscribe does this reordering too.
  */
 #define HB_MODIFIED_COMBINING_CLASS_CCC103 3 /* sara u / sara uu */
 #define HB_MODIFIED_COMBINING_CLASS_CCC107 107 /* mai * */
@@ -273,7 +274,7 @@ extern HB_INTERNAL const hb_unicode_funcs_t _hb_unicode_funcs_nil;
 /* Tibetan */
 #define HB_MODIFIED_COMBINING_CLASS_CCC129 129 /* sign aa */
 #define HB_MODIFIED_COMBINING_CLASS_CCC130 130 /* sign i */
-#define HB_MODIFIED_COMBINING_CLASS_CCC133 132 /* sign u */
+#define HB_MODIFIED_COMBINING_CLASS_CCC132 132 /* sign u */
 
 
 #endif /* HB_UNICODE_PRIVATE_HH */
index 30dc7de..8979eaa 100644 (file)
@@ -358,7 +358,7 @@ _hb_modified_combining_class[256] =
   HB_MODIFIED_COMBINING_CLASS_CCC129,
   HB_MODIFIED_COMBINING_CLASS_CCC130,
   131,
-  HB_MODIFIED_COMBINING_CLASS_CCC133,
+  HB_MODIFIED_COMBINING_CLASS_CCC132,
   133, 134, 135, 136, 137, 138, 139,