src/hb-ot-shape-complex-khmer.cc | 15 +++++++++------ src/hb-ot-shape.cc | 6 +++--- 2 files changed, 12 insertions(+), 9 deletions(-)
New commits: commit 000d4b128eba58677acdc3b361829ff2f9a257b1 Author: Behdad Esfahbod <[email protected]> Date: Thu Nov 29 12:32:47 2018 -0500 Make shaper's override_features() override user features as well The override_features is used to override features that are normally discretionary features, but in a specific shaper are for various reasons desired to be bolted on or off, because they've been used for inherent shaping. As such, it makes sense that they also override user features. Ie. if user turned 'liga' on, we don't want Khmer shaping to become broken... Or turn 'clig' off... Fixes https://github.com/harfbuzz/harfbuzz/issues/1310 diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index ef974357..e0074d53 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -309,9 +309,6 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner, map->enable_feature (HB_TAG ('v','e','r','t'), F_GLOBAL_SEARCH); } - if (planner->shaper->override_features) - planner->shaper->override_features (planner); - for (unsigned int i = 0; i < num_user_features; i++) { const hb_feature_t *feature = &user_features[i]; @@ -330,6 +327,9 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner, aat_map->add_feature (feature->tag, feature->value); } } + + if (planner->shaper->override_features) + planner->shaper->override_features (planner); } commit a95d9d8c8465ebc927bc2194dffe4ea95542e54c Author: Behdad Esfahbod <[email protected]> Date: Thu Nov 29 12:30:14 2018 -0500 [khmer] Move 'clig' to overrides Prerequisite for https://github.com/harfbuzz/harfbuzz/issues/1310 diff --git a/src/hb-ot-shape-complex-khmer.cc b/src/hb-ot-shape-complex-khmer.cc index 497891ea..8b6ec51d 100644 --- a/src/hb-ot-shape-complex-khmer.cc +++ b/src/hb-ot-shape-complex-khmer.cc @@ -127,22 +127,25 @@ collect_features_khmer (hb_ot_shape_planner_t *plan) for (; i < KHMER_NUM_FEATURES; i++) map->add_feature (khmer_features[i]); - - map->enable_feature (HB_TAG('c','a','l','t')); - map->enable_feature (HB_TAG('c','l','i','g')); - } static void override_features_khmer (hb_ot_shape_planner_t *plan) { + hb_ot_map_builder_t *map = &plan->map; + + /* Khmer spec has 'clig' as part of required shaping features: + * "Apply feature 'clig' to form ligatures that are desired for + * typographical correctness.", hence in overrides... */ + map->enable_feature (HB_TAG('c','l','i','g')); + /* Uniscribe does not apply 'kern' in Khmer. */ if (hb_options ().uniscribe_bug_compatible) { - plan->map.disable_feature (HB_TAG('k','e','r','n')); + map->disable_feature (HB_TAG('k','e','r','n')); } - plan->map.disable_feature (HB_TAG('l','i','g','a')); + map->disable_feature (HB_TAG('l','i','g','a')); } _______________________________________________ HarfBuzz mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/harfbuzz
