[indic] Add support for Grantha marks that may be used in Tamil to th… (#401)
authorjfkthame <jfkthame@gmail.com>
Thu, 16 Feb 2017 17:40:21 +0000 (17:40 +0000)
committerBehdad Esfahbod <behdad@behdad.org>
Thu, 16 Feb 2017 17:40:21 +0000 (09:40 -0800)
* [indic] Add support for Grantha marks that may be used in Tamil to the Indic table.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1331339.

Testcase: U+0BA4,U+0BC6,U+1133c,U+0BAA,U+1133c,U+0BC6,U+1133c

* [indic] Add test for Grantha nukta that is allowed in Tamil by ScriptExtensions.txt

src/hb-ot-shape-complex-indic-table.cc
test/shaping/fonts/sha1sum/3493e92eaded2661cadde752a39f9d58b11f0326.ttf [new file with mode: 0644]
test/shaping/tests/indic-script-extensions.tests [new file with mode: 0644]

index 80a6b25..e10a4d2 100644 (file)
@@ -422,6 +422,13 @@ hb_indic_get_categories (hb_codepoint_t u)
       if (hb_in_range (u, 0xAA60u, 0xAA7Fu)) return indic_table[u - 0xAA60u + indic_offset_0xaa60u];
       break;
 
+    case 0x11u:
+      // According to ScriptExtensions.txt, these Grantha marks may also be used in Tamil,
+      // so the Indic shaper needs to know their categories.
+      if (unlikely (u == 0x11303)) return _(Vs,R);
+      if (unlikely (u == 0x1133c)) return _(N,B);
+      break;
+
     default:
       break;
   }
diff --git a/test/shaping/fonts/sha1sum/3493e92eaded2661cadde752a39f9d58b11f0326.ttf b/test/shaping/fonts/sha1sum/3493e92eaded2661cadde752a39f9d58b11f0326.ttf
new file mode 100644 (file)
index 0000000..006adb6
Binary files /dev/null and b/test/shaping/fonts/sha1sum/3493e92eaded2661cadde752a39f9d58b11f0326.ttf differ
diff --git a/test/shaping/tests/indic-script-extensions.tests b/test/shaping/tests/indic-script-extensions.tests
new file mode 100644 (file)
index 0000000..52b6aa0
--- /dev/null
@@ -0,0 +1 @@
+fonts/sha1sum/3493e92eaded2661cadde752a39f9d58b11f0326.ttf::U+0BA4,U+0BC6,U+D804,U+DF3C,U+0BAA,U+D804,U+DF3C,U+0BC6,U+D804,U+DF3C:[u0BC6=0+2093|u1133C=0+0|u0BA4=0+1863|u0BC6=3+2093|u1133C=3+0|u0BAA=3+1706|u1133C=3+0]