From ec925ece05f3de0ba49a7712a4a2ebb389c54f70 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 13 Apr 2022 11:51:48 -0600 Subject: [PATCH] [khmer] Reinstate a pause after basic features This was removed as part of 044d7a06db552e1564b8575f4d23798f009d9dde, which caused the regression. Just adding a pause fixes the shaping. Debugged by just tracing the good/bad shaping and observing the lookup orders intermingling in the bad shaping. Test: hb-shape LeelawUI.ttf --unicodes U+1780,U+17D2,U+179A,U+17BB Fixes https://github.com/harfbuzz/harfbuzz/issues/3531 --- src/hb-ot-shape-complex-khmer.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-shape-complex-khmer.cc b/src/hb-ot-shape-complex-khmer.cc index d7ec1632e..a7d5bf574 100644 --- a/src/hb-ot-shape-complex-khmer.cc +++ b/src/hb-ot-shape-complex-khmer.cc @@ -110,7 +110,14 @@ collect_features_khmer (hb_ot_shape_planner_t *plan) map->enable_feature (HB_TAG('l','o','c','l'), F_PER_SYLLABLE); map->enable_feature (HB_TAG('c','c','m','p'), F_PER_SYLLABLE); - for (unsigned i = 0; i < KHMER_NUM_FEATURES; i++) + unsigned int i = 0; + for (; i < KHMER_BASIC_FEATURES; i++) + map->add_feature (khmer_features[i]); + + /* https://github.com/harfbuzz/harfbuzz/issues/3531 */ + map->add_gsub_pause (nullptr); + + for (; i < KHMER_NUM_FEATURES; i++) map->add_feature (khmer_features[i]); }