From c1432bce3cfc1156d19b21892d4083afa8838d94 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 14 Jul 2017 17:34:47 +0100 Subject: [PATCH] [arabic] Adjust feature order again Fixes https://github.com/behdad/harfbuzz/issues/505 --- src/hb-ot-shape-complex-arabic.cc | 7 ++++++- .../bf39b0e91ef9807f15a9e283a21a14a209fd2cfc.ttf | Bin 0 -> 7312 bytes test/shaping/tests/arabic-feature-order.tests | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 test/shaping/fonts/sha1sum/bf39b0e91ef9807f15a9e283a21a14a209fd2cfc.ttf diff --git a/src/hb-ot-shape-complex-arabic.cc b/src/hb-ot-shape-complex-arabic.cc index c6609c575..5dbbcd9af 100644 --- a/src/hb-ot-shape-complex-arabic.cc +++ b/src/hb-ot-shape-complex-arabic.cc @@ -199,6 +199,9 @@ collect_features_arabic (hb_ot_shape_planner_t *plan) * work. However, testing shows that rlig and calt are applied * together for Mongolian in Uniscribe. As such, we only add a * pause for Arabic, not other scripts. + * + * A pause after calt is required to make KFGQPC Uthmanic Script HAFS + * work correctly. See https://github.com/behdad/harfbuzz/issues/505 */ map->add_gsub_pause (nuke_joiners); @@ -222,7 +225,10 @@ collect_features_arabic (hb_ot_shape_planner_t *plan) if (plan->props.script == HB_SCRIPT_ARABIC) map->add_gsub_pause (arabic_fallback_shape); + /* No pause after rclt. See 98460779bae19e4d64d29461ff154b3527bf8420. */ + map->add_global_bool_feature (HB_TAG('r','c','l','t')); map->add_global_bool_feature (HB_TAG('c','a','l','t')); + map->add_gsub_pause (NULL); /* The spec includes 'cswh'. Earlier versions of Windows * used to enable this by default, but testing suggests @@ -232,7 +238,6 @@ collect_features_arabic (hb_ot_shape_planner_t *plan) * Note that IranNastaliq uses this feature extensively * to fixup broken glyph sequences. Oh well... * Test case: U+0643,U+0640,U+0631. */ - //map->add_gsub_pause (NULL); //map->add_global_bool_feature (HB_TAG('c','s','w','h')); map->add_global_bool_feature (HB_TAG('m','s','e','t')); } diff --git a/test/shaping/fonts/sha1sum/bf39b0e91ef9807f15a9e283a21a14a209fd2cfc.ttf b/test/shaping/fonts/sha1sum/bf39b0e91ef9807f15a9e283a21a14a209fd2cfc.ttf new file mode 100644 index 0000000000000000000000000000000000000000..ce017a35a364e5d1440051258955e0ac8e80a727 GIT binary patch literal 7312 zcmb7J33OXmnZC>0Bt32KX_qC-k}buuElaX2d5g0+v7N?A9B1Dg+gaVlNl4P6&9qRM zF0{i|y1=k6Ep#YNO6atO)18?^VW1RB=X3^!p*?V54jm}x3{%>YXukU-$4&}|gXH&g zw|D>le)s#AcTFfE#6@l(oJ@_ZT0Km@MIIw0;6v-!$oPg$TOZ!TQJ*4&-#D^q%gS5y z+rCCf_~(SMuWZ=VS-j`ItL`JjcopNP_RUQn*B>StQ9C%(r-E-*3 zwFh4cziwTBuNp4*r}Z`tQ%cq#f4Y-UGgNU5YobPG?Ok>1}Xl6aT;{-pcznI6o08? zI+LT_rE;YlXQ-pQt60W3zV3aBJ7`l}aks2-y|2R+aLH`iPvwovm*2Z{>-&qvo@HIK zUEwqrjmPe|uIE^>xNVI8C_A3kWoN7}rb&9?U^JABMLp*uU*|jTEOqym^7&i0?s{Oo zjoO@i=hN%f?F)rMqe5S69efYjONd<8EXOiwOD{hZj`LtZ=!HM5Cdb8JdXQBH(Zv*1 z!7_L%>0+u95M#w~7nAN-^|6VG2Y2oM!nJECA6lkp3iGvuxYt;*^-%A`gWI-!Zph2r zVOwm~$m&>Ae|wa&V0(WuHNI(cCR;S^UhZH@q`57WKQy_V*dyfrsyk0%evg8k>6>|WQ+O7+@ z(y9x90a9KmW7liYR>~~HscMtM%bHVT>GJ-RlQOsA1qB#$dJRSK7LJ!wLyd{Pi1vHt z4FqhNvf=eI771!LH4-u+HfKk^O}E>EF~;n=BNfrGyEoG-S(b;0U^12<_*mb}u40@8 z1sOp@{H2mA2wL0ei@HL$dz6*Be~GTz?5@^uxTit)dmUU=y{1i*6(#I0q}|I}BKc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