*/
static const hb_tag_t
-myanmar_features[] =
+basic_features[] =
{
/*
* Basic features.
HB_TAG('p','r','e','f'),
HB_TAG('b','l','w','f'),
HB_TAG('p','s','t','f'),
+};
+static const hb_tag_t
+other_features[] =
+{
/*
* Other features.
* These features are applied all at once, after final_reordering.
HB_TAG('d','i','s','t'),
};
-/*
- * Must be in the same order as the myanmar_features array.
- */
-enum {
- _RPHF,
- _PREF,
- _BLWF,
- _PSTF,
-
- _PRES,
- _ABVS,
- _BLWS,
- _PSTS,
- _DIST,
-
- MYANMAR_NUM_FEATURES,
- MYANMAR_BASIC_FEATURES = _PRES /* Don't forget to update this! */
-};
-
static void
setup_syllables (const hb_ot_shape_plan_t *plan,
hb_font_t *font,
map->add_global_bool_feature (HB_TAG('c','c','m','p'));
- unsigned int i = 0;
map->add_gsub_pause (initial_reordering);
- for (; i < MYANMAR_BASIC_FEATURES; i++) {
- map->add_feature (myanmar_features[i], 1, F_GLOBAL | F_MANUAL_JOINERS);
+ for (unsigned int i = 0; i < ARRAY_LENGTH (basic_features); i++)
+ {
+ map->add_feature (basic_features[i], 1, F_GLOBAL | F_MANUAL_JOINERS);
map->add_gsub_pause (NULL);
}
map->add_gsub_pause (final_reordering);
- for (; i < MYANMAR_NUM_FEATURES; i++) {
- map->add_feature (myanmar_features[i], 1, F_GLOBAL);
- }
+ for (unsigned int i = 0; i < ARRAY_LENGTH (other_features); i++)
+ map->add_feature (other_features[i], 1, F_GLOBAL);
}
static void
*/
static const hb_tag_t
-sea_features[] =
+basic_features[] =
{
/*
* Basic features.
HB_TAG('a','b','v','f'),
HB_TAG('b','l','w','f'),
HB_TAG('p','s','t','f'),
+};
+static const hb_tag_t
+other_features[] =
+{
/*
* Other features.
* These features are applied all at once, after final_reordering.
HB_TAG('d','i','s','t'),
};
-/*
- * Must be in the same order as the sea_features array.
- */
-enum {
- _PREF,
- _ABVF,
- _BLWF,
- _PSTF,
-
- _PRES,
- _ABVS,
- _BLWS,
- _PSTS,
- _DIST,
-
- SEA_NUM_FEATURES,
- SEA_BASIC_FEATURES = _PRES /* Don't forget to update this! */
-};
-
static void
setup_syllables (const hb_ot_shape_plan_t *plan,
hb_font_t *font,
* there is a use of it, it's typically at the beginning. */
map->add_global_bool_feature (HB_TAG('c','c','m','p'));
-
- unsigned int i = 0;
map->add_gsub_pause (initial_reordering);
- for (; i < SEA_BASIC_FEATURES; i++) {
- map->add_feature (sea_features[i], 1, F_GLOBAL | F_MANUAL_JOINERS);
+ for (unsigned int i = 0; i < ARRAY_LENGTH (basic_features); i++)
+ {
+ map->add_feature (basic_features[i], 1, F_GLOBAL | F_MANUAL_JOINERS);
map->add_gsub_pause (NULL);
}
map->add_gsub_pause (final_reordering);
- for (; i < SEA_NUM_FEATURES; i++) {
- map->add_feature (sea_features[i], 1, F_GLOBAL | F_MANUAL_JOINERS);
- }
+ for (unsigned int i = 0; i < ARRAY_LENGTH (other_features); i++)
+ map->add_feature (other_features[i], 1, F_GLOBAL);
}
static void
break;
}
-#define ADD_FEATURES(array) \
- HB_STMT_START { \
- for (unsigned int i = 0; i < ARRAY_LENGTH (array); i++) \
- map->add_global_bool_feature (array[i]); \
- } HB_STMT_END
-
if (planner->shaper->collect_features)
planner->shaper->collect_features (planner);
- ADD_FEATURES (common_features);
+ for (unsigned int i = 0; i < ARRAY_LENGTH (common_features); i++)
+ map->add_global_bool_feature (common_features[i]);
if (HB_DIRECTION_IS_HORIZONTAL (props->direction))
- ADD_FEATURES (horizontal_features);
+ for (unsigned int i = 0; i < ARRAY_LENGTH (horizontal_features); i++)
+ map->add_global_bool_feature (horizontal_features[i]);
else
- ADD_FEATURES (vertical_features);
+ for (unsigned int i = 0; i < ARRAY_LENGTH (vertical_features); i++)
+ map->add_global_bool_feature (vertical_features[i]);
if (planner->shaper->override_features)
planner->shaper->override_features (planner);
-#undef ADD_FEATURES
-
for (unsigned int i = 0; i < num_user_features; i++) {
const hb_feature_t *feature = &user_features[i];
map->add_feature (feature->tag, feature->value,