From: Behdad Esfahbod Date: Fri, 10 Aug 2012 01:12:30 +0000 (-0400) Subject: Fill out combining class resetting for fallback shaping Thai/Lao/Tibetan X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=56c9e7c004e802ddcb8c704346026f1d7a812f9f;p=platform%2Fupstream%2FlibHarfBuzzSharp.git Fill out combining class resetting for fallback shaping Thai/Lao/Tibetan --- diff --git a/src/hb-ot-shape-fallback.cc b/src/hb-ot-shape-fallback.cc index 71aed89..abc7e2b 100644 --- a/src/hb-ot-shape-fallback.cc +++ b/src/hb-ot-shape-fallback.cc @@ -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; diff --git a/src/hb-unicode-private.hh b/src/hb-unicode-private.hh index b2af7c8..53214b9 100644 --- a/src/hb-unicode-private.hh +++ b/src/hb-unicode-private.hh @@ -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 */ diff --git a/src/hb-unicode.cc b/src/hb-unicode.cc index 30dc7de..8979eaa 100644 --- a/src/hb-unicode.cc +++ b/src/hb-unicode.cc @@ -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,