summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2017-07-14 14:14:35 +0100
committerBehdad Esfahbod <behdad@behdad.org>2017-07-14 14:22:52 +0100
commite359a4b8f57bbc778843f233c4f5d6fb07ff11d9 (patch)
tree37a202a30dd7de10d72a166dc2671e2ed373940a
parentcdf1fd0627c5517c948ca05d2e9427c3e441adf9 (diff)
[indic] Disable automatic ZWNJ handling for Indic features
Fixes https://github.com/behdad/harfbuzz/issues/294 Also fixes a bunch of other Indic issues. Test results after: BENGALI: 353725 out of 354188 tests passed. 463 failed (0.130722%) DEVANAGARI: 707307 out of 707394 tests passed. 87 failed (0.0122987%) GUJARATI: 366355 out of 366457 tests passed. 102 failed (0.0278341%) GURMUKHI: 60732 out of 60747 tests passed. 15 failed (0.0246926%) KANNADA: 951201 out of 951913 tests passed. 712 failed (0.0747968%) KHMER: 299071 out of 299124 tests passed. 53 failed (0.0177184%) MALAYALAM: 1048136 out of 1048334 tests passed. 198 failed (0.0188871%) ORIYA: 42320 out of 42329 tests passed. 9 failed (0.021262%) SINHALA: 271662 out of 271847 tests passed. 185 failed (0.068053%) TAMIL: 1091754 out of 1091754 tests passed. 0 failed (0%) TELUGU: 970555 out of 970573 tests passed. 18 failed (0.00185457%) Before: BENGALI: 353725 out of 354188 tests passed. 463 failed (0.130722%) DEVANAGARI: 707307 out of 707394 tests passed. 87 failed (0.0122987%) GUJARATI: 366349 out of 366457 tests passed. 108 failed (0.0294714%) GURMUKHI: 60732 out of 60747 tests passed. 15 failed (0.0246926%) KANNADA: 951190 out of 951913 tests passed. 723 failed (0.0759523%) KHMER: 299070 out of 299124 tests passed. 54 failed (0.0180527%) MALAYALAM: 1048136 out of 1048334 tests passed. 198 failed (0.0188871%) ORIYA: 42320 out of 42329 tests passed. 9 failed (0.021262%) SINHALA: 271662 out of 271847 tests passed. 185 failed (0.068053%) TAMIL: 1091753 out of 1091754 tests passed. 1 failed (9.15957e-05%) TELUGU: 970555 out of 970573 tests passed. 18 failed (0.00185457%)
-rw-r--r--src/hb-ot-shape-complex-indic.cc4
-rw-r--r--test/shaping/Makefile.am1
-rw-r--r--test/shaping/fonts/sha1sum/f443753e8ffe8e8aae606cfba158e00334b6efb1.ttfbin0 -> 3972 bytes
-rw-r--r--test/shaping/tests/indic-joiners.tests2
4 files changed, 5 insertions, 2 deletions
diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc
index cbc46c8c..8227a77d 100644
--- a/src/hb-ot-shape-complex-indic.cc
+++ b/src/hb-ot-shape-complex-indic.cc
@@ -411,12 +411,12 @@ collect_features_indic (hb_ot_shape_planner_t *plan)
unsigned int i = 0;
map->add_gsub_pause (initial_reordering);
for (; i < INDIC_BASIC_FEATURES; i++) {
- map->add_feature (indic_features[i].tag, 1, indic_features[i].flags | F_MANUAL_ZWJ);
+ map->add_feature (indic_features[i].tag, 1, indic_features[i].flags | F_MANUAL_ZWJ | F_MANUAL_ZWNJ);
map->add_gsub_pause (NULL);
}
map->add_gsub_pause (final_reordering);
for (; i < INDIC_NUM_FEATURES; i++) {
- map->add_feature (indic_features[i].tag, 1, indic_features[i].flags | F_MANUAL_ZWJ);
+ map->add_feature (indic_features[i].tag, 1, indic_features[i].flags | F_MANUAL_ZWJ | F_MANUAL_ZWNJ);
}
map->add_global_bool_feature (HB_TAG('c','a','l','t'));
diff --git a/test/shaping/Makefile.am b/test/shaping/Makefile.am
index 410a258d..f84b4671 100644
--- a/test/shaping/Makefile.am
+++ b/test/shaping/Makefile.am
@@ -56,6 +56,7 @@ TESTS = \
tests/hangul-jamo.tests \
tests/hyphens.tests \
tests/indic-joiner-candrabindu.tests \
+ tests/indic-joiners.tests \
tests/indic-old-spec.tests \
tests/indic-pref-blocking.tests \
tests/language-tags.tests \
diff --git a/test/shaping/fonts/sha1sum/f443753e8ffe8e8aae606cfba158e00334b6efb1.ttf b/test/shaping/fonts/sha1sum/f443753e8ffe8e8aae606cfba158e00334b6efb1.ttf
new file mode 100644
index 00000000..93c2f582
--- /dev/null
+++ b/test/shaping/fonts/sha1sum/f443753e8ffe8e8aae606cfba158e00334b6efb1.ttf
Binary files differ
diff --git a/test/shaping/tests/indic-joiners.tests b/test/shaping/tests/indic-joiners.tests
new file mode 100644
index 00000000..63f67290
--- /dev/null
+++ b/test/shaping/tests/indic-joiners.tests
@@ -0,0 +1,2 @@
+fonts/sha1sum/f443753e8ffe8e8aae606cfba158e00334b6efb1.ttf::U+179A,U+1784,U+17D2,U+179F,U+200C,U+17CA,U+17B8,U+0020:[uni179a=0+775|uni1784=1+1550|uni179f.sub=1+775|space=1+0|uni17ca=1+0|uni17b8=1@0,300+0|space=7+600]
+fonts/sha1sum/f443753e8ffe8e8aae606cfba158e00334b6efb1.ttf::U+179A,U+1784,U+17D2,U+179F,U+17CA,U+17B8:[uni179a=0+775|uni1784=1+1550|uni179f.sub=1+775|uni17bb=1@-75,-700+0|uni17b8=1+0]