Imported Upstream version 1.7.6
[platform/upstream/harfbuzz.git] / src / hb-unicode-private.hh
index a4d118b..82bb9a4 100644 (file)
@@ -108,7 +108,7 @@ HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE
     /* XXX This hack belongs to the Myanmar shaper. */
     if (unlikely (unicode == 0x1037u)) unicode = 0x103Au;
 
-    /* XXX This hack belongs to the SEA shaper (for Tai Tham):
+    /* XXX This hack belongs to the USE shaper (for Tai Tham):
      * Reorder SAKOT to ensure it comes after any tone marks. */
     if (unlikely (unicode == 0x1A60u)) return 254;
 
@@ -126,7 +126,7 @@ HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE
   {
     /* U+180B..180D MONGOLIAN FREE VARIATION SELECTORs are handled in the
      * Arabic shaper.  No need to match them here. */
-    return unlikely (hb_in_ranges (unicode,
+    return unlikely (hb_in_ranges<hb_codepoint_t> (unicode,
                                   0xFE00u, 0xFE0Fu, /* VARIATION SELECTOR-1..16 */
                                   0xE0100u, 0xE01EFu));  /* VARIATION SELECTOR-17..256 */
   }
@@ -137,6 +137,7 @@ HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE
    * we do NOT want to hide them, as the way Uniscribe has implemented them
    * is with regular spacing glyphs, and that's the way fonts are made to work.
    * As such, we make exceptions for those four.
+   * Also ignoring U+1BCA0..1BCA3. https://github.com/harfbuzz/harfbuzz/issues/503
    *
    * Unicode 7.0:
    * $ grep '; Default_Ignorable_Code_Point ' DerivedCoreProperties.txt | sed 's/;.*#/#/'
@@ -179,13 +180,13 @@ HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE
        case 0x00: return unlikely (ch == 0x00ADu);
        case 0x03: return unlikely (ch == 0x034Fu);
        case 0x06: return unlikely (ch == 0x061Cu);
-       case 0x17: return hb_in_range (ch, 0x17B4u, 0x17B5u);
-       case 0x18: return hb_in_range (ch, 0x180Bu, 0x180Eu);
-       case 0x20: return hb_in_ranges (ch, 0x200Bu, 0x200Fu,
+       case 0x17: return hb_in_range<hb_codepoint_t> (ch, 0x17B4u, 0x17B5u);
+       case 0x18: return hb_in_range<hb_codepoint_t> (ch, 0x180Bu, 0x180Eu);
+       case 0x20: return hb_in_ranges<hb_codepoint_t> (ch, 0x200Bu, 0x200Fu,
                                            0x202Au, 0x202Eu,
                                            0x2060u, 0x206Fu);
-       case 0xFE: return hb_in_range (ch, 0xFE00u, 0xFE0Fu) || ch == 0xFEFFu;
-       case 0xFF: return hb_in_range (ch, 0xFFF0u, 0xFFF8u);
+       case 0xFE: return hb_in_range<hb_codepoint_t> (ch, 0xFE00u, 0xFE0Fu) || ch == 0xFEFFu;
+       case 0xFF: return hb_in_range<hb_codepoint_t> (ch, 0xFFF0u, 0xFFF8u);
        default: return false;
       }
     }
@@ -193,9 +194,8 @@ HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE
     {
       /* Other planes */
       switch (plane) {
-       case 0x01: return hb_in_ranges (ch, 0x1BCA0u, 0x1BCA3u,
-                                           0x1D173u, 0x1D17Au);
-       case 0x0E: return hb_in_range (ch, 0xE0000u, 0xE0FFFu);
+       case 0x01: return hb_in_range<hb_codepoint_t> (ch, 0x1D173u, 0x1D17Au);
+       case 0x0E: return hb_in_range<hb_codepoint_t> (ch, 0xE0000u, 0xE0FFFu);
        default: return false;
       }
     }
@@ -346,23 +346,24 @@ extern HB_INTERNAL const hb_unicode_funcs_t _hb_unicode_funcs_nil;
 #define HB_MODIFIED_COMBINING_CLASS_CCC122 122 /* mai * */
 
 /* Tibetan
- * Modify U+0F74 (ccc=132) to reorder before ccc=130 marks.
+ * 
+ * In case of multiple vowel-signs, use u first (but after achung) 
+ * this allows Dzongkha multi-vowel shortcuts to render correctly 
  */
 #define HB_MODIFIED_COMBINING_CLASS_CCC129 129 /* sign aa */
-#define HB_MODIFIED_COMBINING_CLASS_CCC130 130 /* sign i */
-#define HB_MODIFIED_COMBINING_CLASS_CCC132 128 /* sign u */
-
+#define HB_MODIFIED_COMBINING_CLASS_CCC130 132 /* sign i */
+#define HB_MODIFIED_COMBINING_CLASS_CCC132 131 /* sign u */
 
 /* Misc */
 
 #define HB_UNICODE_GENERAL_CATEGORY_IS_MARK(gen_cat) \
-       (FLAG_SAFE (gen_cat) & \
+       (FLAG_UNSAFE (gen_cat) & \
         (FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | \
          FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | \
          FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)))
 
 #define HB_UNICODE_GENERAL_CATEGORY_IS_NON_ENCLOSING_MARK_OR_MODIFIER_SYMBOL(gen_cat) \
-       (FLAG_SAFE (gen_cat) & \
+       (FLAG_UNSAFE (gen_cat) & \
         (FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | \
          FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) | \
          FLAG (HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL)))