From 3cc84f45b995b243fca82ce18481f11d69846eb5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 14 Jul 2017 15:50:22 +0100 Subject: [PATCH] [indic] Fix https://github.com/behdad/harfbuzz/issues/478 --- src/hb-ot-shape-complex-indic-private.hh | 2 +- src/hb-ot-shape-complex-indic.cc | 8 ++++++++ test/shaping/Makefile.am | 1 + .../54674a3111d209fb6be0ed31745314b7a8d2c244.ttf | Bin 0 -> 1352 bytes test/shaping/tests/indic-syllable.tests | 1 + 5 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 test/shaping/fonts/sha1sum/54674a3111d209fb6be0ed31745314b7a8d2c244.ttf create mode 100644 test/shaping/tests/indic-syllable.tests diff --git a/src/hb-ot-shape-complex-indic-private.hh b/src/hb-ot-shape-complex-indic-private.hh index 5879c3e4..58be4222 100644 --- a/src/hb-ot-shape-complex-indic-private.hh +++ b/src/hb-ot-shape-complex-indic-private.hh @@ -132,7 +132,7 @@ enum indic_syllabic_category_t { INDIC_SYLLABIC_CATEGORY_NUMBER_JOINER = OT_PLACEHOLDER, /* Don't care. */ INDIC_SYLLABIC_CATEGORY_PURE_KILLER = OT_M, /* Is like a vowel matra. */ INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER = OT_RS, - INDIC_SYLLABIC_CATEGORY_SYLLABLE_MODIFIER = OT_M, /* Misc Khmer signs. */ + INDIC_SYLLABIC_CATEGORY_SYLLABLE_MODIFIER = OT_SM, INDIC_SYLLABIC_CATEGORY_TONE_LETTER = OT_X, INDIC_SYLLABIC_CATEGORY_TONE_MARK = OT_N, INDIC_SYLLABIC_CATEGORY_VIRAMA = OT_H, diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 8227a77d..97cec38e 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -200,6 +200,14 @@ set_indic_properties (hb_glyph_info_t &info) cat = OT_Symbol; ASSERT_STATIC ((int) INDIC_SYLLABIC_CATEGORY_AVAGRAHA == OT_Symbol); } + else if (unlikely (hb_in_range (u, 0x17CDu, 0x17D1u) || + u == 0x17CBu || u == 0x17D3u || u == 0x17DDu)) /* Khmer Various signs */ + { + /* These can occur mid-syllable (eg. before matras), even though Unicode marks them as Syllable_Modifier. */ + cat = OT_M; + pos = POS_ABOVE_C; + } + else if (unlikely (u == 0x17C6u)) cat = OT_N; /* Khmer Bindu doesn't like to be repositioned. */ else if (unlikely (hb_in_range (u, 0x2010u, 0x2011u))) cat = OT_PLACEHOLDER; diff --git a/test/shaping/Makefile.am b/test/shaping/Makefile.am index f84b4671..48569f0b 100644 --- a/test/shaping/Makefile.am +++ b/test/shaping/Makefile.am @@ -59,6 +59,7 @@ TESTS = \ tests/indic-joiners.tests \ tests/indic-old-spec.tests \ tests/indic-pref-blocking.tests \ + tests/indic-syllable.tests \ tests/language-tags.tests \ tests/ligature-id.tests \ tests/mark-filtering-sets.tests \ diff --git a/test/shaping/fonts/sha1sum/54674a3111d209fb6be0ed31745314b7a8d2c244.ttf b/test/shaping/fonts/sha1sum/54674a3111d209fb6be0ed31745314b7a8d2c244.ttf new file mode 100644 index 0000000000000000000000000000000000000000..837e8d2c7ee73b0c962f23d10a7134e5e85ec8f5 GIT binary patch literal 1352 zcmZWpU2Kz87=F&z)306I6)J5>3@%+eR^tqt{UfkWpwSf<))k6T3~u|f^=F~|R=Un@ z;R1Rgdb2tZ!yrs_!Nk8P5#w+d7$jU^Y&7bHS0u)aE4Ulen6>piZ3WSD^7XvWd(L^@ z_j%7b1p{El31~1Je(w2R*uepQn7ogNqXV%6KlfiEJWcqOaO}m>n24bC_ zslKV3fMz4%;gO7zH7=WO5zZ10CY6aSbkxD4giXoxOk(kfriJXg06UqAE2D-DKXw4p zd*lnG$YIkr&k?41w52lnY3uuy+k}55Y)y}kD7eF(C47dkDWgnh@dUFF&J%X1N+!+~ z(b1050$P_-wps07Pr%Q@yt7hZF1F?6Z!7oyScwk4(5CyO z`Ot@N-)1(parSy?rgZ+B)uTB!yjZz-kTqW}EuB98?(1AVQ@N?Xw=%W-&MxaSu~6?* z`oU20RAldGv!@rD_WW=o_VtC#*$yw;Sy?u{HIhFxI)9NwlzX^ZiOSbtgbB@*y|s~< z*JF2UD$#-N?nr+y7&*zc_k)rCp6*DbSiW4X)>X^bq;`nY)XLK8CS!hv&0R{R* zP7j-=froGmZ{S7^G0Ri6)v>OwkSG{2 zlOEFXkIFhXql|e?yHryo>SCZf=b^`|WYRF_GieX$5ETOL7W3>#Jf{*{y^3PL$eNLd zHC9UWe`O~mI7K{O-Pc%cAm)9KaBq3QU1xb1iS`R6Fw?IJYlA^V63jC7`nid?kI^Sa MPVuB#T(Js&1ET{82><{9 literal 0 HcmV?d00001 diff --git a/test/shaping/tests/indic-syllable.tests b/test/shaping/tests/indic-syllable.tests new file mode 100644 index 00000000..26c38b35 --- /dev/null +++ b/test/shaping/tests/indic-syllable.tests @@ -0,0 +1 @@ +fonts/sha1sum/54674a3111d209fb6be0ed31745314b7a8d2c244.ttf::U+0BA4,U+0BCD,U+00B3:[taprehalftamil=0+1509|uni00B3=2+674] -- GitLab