[use] Fix Brahmi Number Joiner 1107F
authorBehdad Esfahbod <behdad@behdad.org>
Wed, 3 Jan 2018 14:22:07 +0000 (14:22 +0000)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 3 Jan 2018 14:22:07 +0000 (14:22 +0000)
Fixes https://github.com/harfbuzz/harfbuzz/pull/660

src/gen-indic-table.py
src/gen-use-table.py
src/hb-ot-shape-complex-indic-table.cc
src/hb-ot-shape-complex-use-table.cc

index a849db18e261c0d41b180e1066e613606697f718..735b9015ec76313497a0f0a832eb22e11572dcb9 100755 (executable)
@@ -229,13 +229,13 @@ print "  {"
 pages = set([u>>page_bits for u in starts+ends+singles.keys()])
 for p in sorted(pages):
        print "    case 0x%0Xu:" % p
+       for u,d in singles.items ():
+               if p != u>>page_bits: continue
+               print "      if (unlikely (u == 0x%04Xu)) return _(%s,%s);" % (u, short[0][d[0]], short[1][d[1]])
        for (start,end) in zip (starts, ends):
                if p not in [start>>page_bits, end>>page_bits]: continue
                offset = "indic_offset_0x%04xu" % start
                print "      if (hb_in_range<hb_codepoint_t> (u, 0x%04Xu, 0x%04Xu)) return indic_table[u - 0x%04Xu + %s];" % (start, end-1, start, offset)
-       for u,d in singles.items ():
-               if p != u>>page_bits: continue
-               print "      if (unlikely (u == 0x%04Xu)) return _(%s,%s);" % (u, short[0][d[0]], short[1][d[1]])
        print "      break;"
        print ""
 print "    default:"
index bbcaaf89bd73d95f93f591843f89ed549a5e2c79..586e59434a5f9d36c556b12db5431f1350a633a6 100755 (executable)
@@ -462,13 +462,13 @@ print "  {"
 pages = set([u>>page_bits for u in starts+ends+singles.keys()])
 for p in sorted(pages):
        print "    case 0x%0Xu:" % p
+       for u,d in singles.items ():
+               if p != u>>page_bits: continue
+               print "      if (unlikely (u == 0x%04Xu)) return %s;" % (u, d[0])
        for (start,end) in zip (starts, ends):
                if p not in [start>>page_bits, end>>page_bits]: continue
                offset = "use_offset_0x%04xu" % start
                print "      if (hb_in_range<hb_codepoint_t> (u, 0x%04Xu, 0x%04Xu)) return use_table[u - 0x%04Xu + %s];" % (start, end-1, start, offset)
-       for u,d in singles.items ():
-               if p != u>>page_bits: continue
-               print "      if (unlikely (u == 0x%04Xu)) return %s;" % (u, d[0])
        print "      break;"
        print ""
 print "    default:"
index bfd1c6d342953d7e677c4ed31ed331dcf7271547..867cfb33bf11b846fa90f01e4b042f3ba01471a2 100644 (file)
@@ -399,10 +399,10 @@ hb_indic_get_categories (hb_codepoint_t u)
   switch (u >> 12)
   {
     case 0x0u:
+      if (unlikely (u == 0x00A0u)) return _(CP,x);
       if (hb_in_range<hb_codepoint_t> (u, 0x0028u, 0x003Fu)) return indic_table[u - 0x0028u + indic_offset_0x0028u];
       if (hb_in_range<hb_codepoint_t> (u, 0x00B0u, 0x00D7u)) return indic_table[u - 0x00B0u + indic_offset_0x00b0u];
       if (hb_in_range<hb_codepoint_t> (u, 0x0900u, 0x0DF7u)) return indic_table[u - 0x0900u + indic_offset_0x0900u];
-      if (unlikely (u == 0x00A0u)) return _(CP,x);
       break;
 
     case 0x1u:
@@ -412,9 +412,9 @@ hb_indic_get_categories (hb_codepoint_t u)
       break;
 
     case 0x2u:
+      if (unlikely (u == 0x25CCu)) return _(CP,x);
       if (hb_in_range<hb_codepoint_t> (u, 0x2008u, 0x2017u)) return indic_table[u - 0x2008u + indic_offset_0x2008u];
       if (hb_in_range<hb_codepoint_t> (u, 0x2070u, 0x2087u)) return indic_table[u - 0x2070u + indic_offset_0x2070u];
-      if (unlikely (u == 0x25CCu)) return _(CP,x);
       break;
 
     case 0xAu:
index c1a33625a6c5defd6f90a98b64a85e6537926929..7e764cd00812f4102fc9cb813e80fe311c351ea5 100644 (file)
@@ -683,10 +683,10 @@ hb_use_get_categories (hb_codepoint_t u)
   switch (u >> 12)
   {
     case 0x0u:
+      if (unlikely (u == 0x034Fu)) return CGJ;
       if (hb_in_range<hb_codepoint_t> (u, 0x0028u, 0x003Fu)) return use_table[u - 0x0028u + use_offset_0x0028u];
       if (hb_in_range<hb_codepoint_t> (u, 0x00A0u, 0x00D7u)) return use_table[u - 0x00A0u + use_offset_0x00a0u];
       if (hb_in_range<hb_codepoint_t> (u, 0x0900u, 0x0DF7u)) return use_table[u - 0x0900u + use_offset_0x0900u];
-      if (unlikely (u == 0x034Fu)) return CGJ;
       break;
 
     case 0x1u:
@@ -699,10 +699,10 @@ hb_use_get_categories (hb_codepoint_t u)
       break;
 
     case 0x2u:
+      if (unlikely (u == 0x25CCu)) return GB;
       if (hb_in_range<hb_codepoint_t> (u, 0x2008u, 0x2017u)) return use_table[u - 0x2008u + use_offset_0x2008u];
       if (hb_in_range<hb_codepoint_t> (u, 0x2060u, 0x2087u)) return use_table[u - 0x2060u + use_offset_0x2060u];
       if (hb_in_range<hb_codepoint_t> (u, 0x20F0u, 0x20F7u)) return use_table[u - 0x20F0u + use_offset_0x20f0u];
-      if (unlikely (u == 0x25CCu)) return GB;
       break;
 
     case 0xAu:
@@ -719,6 +719,7 @@ hb_use_get_categories (hb_codepoint_t u)
       break;
 
     case 0x11u:
+      if (unlikely (u == 0x1107Fu)) return HN;
       if (hb_in_range<hb_codepoint_t> (u, 0x11000u, 0x110BFu)) return use_table[u - 0x11000u + use_offset_0x11000u];
       if (hb_in_range<hb_codepoint_t> (u, 0x11100u, 0x1123Fu)) return use_table[u - 0x11100u + use_offset_0x11100u];
       if (hb_in_range<hb_codepoint_t> (u, 0x11280u, 0x11377u)) return use_table[u - 0x11280u + use_offset_0x11280u];
@@ -727,7 +728,6 @@ hb_use_get_categories (hb_codepoint_t u)
       if (hb_in_range<hb_codepoint_t> (u, 0x11A00u, 0x11A9Fu)) return use_table[u - 0x11A00u + use_offset_0x11a00u];
       if (hb_in_range<hb_codepoint_t> (u, 0x11C00u, 0x11CB7u)) return use_table[u - 0x11C00u + use_offset_0x11c00u];
       if (hb_in_range<hb_codepoint_t> (u, 0x11D00u, 0x11D5Fu)) return use_table[u - 0x11D00u + use_offset_0x11d00u];
-      if (unlikely (u == 0x1107Fu)) return HN;
       break;
 
     default: