This commit is contained in:
Behdad Esfahbod 2018-10-02 14:48:39 +02:00
parent 94d15528f8
commit 0a371fee4d
5 changed files with 15 additions and 13 deletions

View File

@ -205,8 +205,10 @@ struct hb_ot_map_builder_t
inline void add_feature (const hb_ot_map_feature_t &feat)
{ add_feature (feat.tag, feat.flags); }
inline void enable_feature (hb_tag_t tag)
{ add_feature (tag, F_GLOBAL); }
inline void enable_feature (hb_tag_t tag,
hb_ot_map_feature_flags_t flags=F_NONE,
unsigned int value=1)
{ add_feature (tag, F_GLOBAL | flags, value); }
inline void disable_feature (hb_tag_t tag)
{ add_feature (tag, F_GLOBAL, 0); }

View File

@ -215,14 +215,14 @@ collect_features_arabic (hb_ot_shape_planner_t *plan)
* however, it says a ZWJ should also mean "don't ligate". So we run
* the main ligating features as MANUAL_ZWJ. */
map->add_feature (HB_TAG('r','l','i','g'), F_GLOBAL | F_MANUAL_ZWJ | F_HAS_FALLBACK);
map->enable_feature (HB_TAG('r','l','i','g'), F_MANUAL_ZWJ | F_HAS_FALLBACK);
if (plan->props.script == HB_SCRIPT_ARABIC)
map->add_gsub_pause (arabic_fallback_shape);
/* No pause after rclt. See 98460779bae19e4d64d29461ff154b3527bf8420. */
map->add_feature (HB_TAG('r','c','l','t'), F_GLOBAL | F_MANUAL_ZWJ);
map->add_feature (HB_TAG('c','a','l','t'), F_GLOBAL | F_MANUAL_ZWJ);
map->enable_feature (HB_TAG('r','c','l','t'), F_MANUAL_ZWJ);
map->enable_feature (HB_TAG('c','a','l','t'), F_MANUAL_ZWJ);
map->add_gsub_pause (nullptr);
/* And undo here. */

View File

@ -106,14 +106,14 @@ collect_features_myanmar (hb_ot_shape_planner_t *plan)
for (unsigned int i = 0; i < ARRAY_LENGTH (basic_features); i++)
{
map->add_feature (basic_features[i], F_GLOBAL | F_MANUAL_ZWJ);
map->enable_feature (basic_features[i], F_MANUAL_ZWJ);
map->add_gsub_pause (nullptr);
}
map->add_gsub_pause (final_reordering);
for (unsigned int i = 0; i < ARRAY_LENGTH (other_features); i++)
map->add_feature (other_features[i], F_GLOBAL | F_MANUAL_ZWJ);
map->enable_feature (other_features[i], F_MANUAL_ZWJ);
for (unsigned int i = 0; i < ARRAY_LENGTH (positioning_features); i++)
map->enable_feature (positioning_features[i]);

View File

@ -132,19 +132,19 @@ collect_features_use (hb_ot_shape_planner_t *plan)
map->enable_feature (HB_TAG('l','o','c','l'));
map->enable_feature (HB_TAG('c','c','m','p'));
map->enable_feature (HB_TAG('n','u','k','t'));
map->add_feature (HB_TAG('a','k','h','n'), F_GLOBAL | F_MANUAL_ZWJ);
map->enable_feature (HB_TAG('a','k','h','n'), F_MANUAL_ZWJ);
/* "Reordering group" */
map->add_gsub_pause (clear_substitution_flags);
map->add_feature (HB_TAG('r','p','h','f'), F_MANUAL_ZWJ);
map->add_gsub_pause (record_rphf);
map->add_gsub_pause (clear_substitution_flags);
map->add_feature (HB_TAG('p','r','e','f'), F_GLOBAL | F_MANUAL_ZWJ);
map->enable_feature (HB_TAG('p','r','e','f'), F_MANUAL_ZWJ);
map->add_gsub_pause (record_pref);
/* "Orthographic unit shaping group" */
for (unsigned int i = 0; i < ARRAY_LENGTH (basic_features); i++)
map->add_feature (basic_features[i], F_GLOBAL | F_MANUAL_ZWJ);
map->enable_feature (basic_features[i], F_MANUAL_ZWJ);
map->add_gsub_pause (reorder);
@ -155,7 +155,7 @@ collect_features_use (hb_ot_shape_planner_t *plan)
/* "Standard typographic presentation" */
for (unsigned int i = 0; i < ARRAY_LENGTH (other_features); i++)
map->add_feature (other_features[i], F_GLOBAL | F_MANUAL_ZWJ);
map->enable_feature (other_features[i], F_MANUAL_ZWJ);
/* "Positional feature application" */
for (unsigned int i = 0; i < ARRAY_LENGTH (positioning_features); i++)

View File

@ -125,7 +125,7 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
map->add_feature (HB_TAG ('d','n','o','m'));
/* Random! */
map->add_feature (HB_TAG ('r','a','n','d'), F_GLOBAL | F_RANDOM, HB_OT_MAP_MAX_VALUE);
map->enable_feature (HB_TAG ('r','a','n','d'), F_RANDOM, HB_OT_MAP_MAX_VALUE);
if (planner->shaper->collect_features)
planner->shaper->collect_features (planner);
@ -142,7 +142,7 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
* matter which script/langsys it is listed (or not) under.
* See various bugs referenced from:
* https://github.com/harfbuzz/harfbuzz/issues/63 */
map->add_feature (HB_TAG ('v','e','r','t'), F_GLOBAL | F_GLOBAL_SEARCH);
map->enable_feature (HB_TAG ('v','e','r','t'), F_GLOBAL_SEARCH);
}
if (planner->shaper->override_features)