unsigned int nesting_level_left;
unsigned int debug_depth;
+ bool has_glyph_classes;
bool auto_zwnj;
bool auto_zwj;
bool random;
+
uint64_t random_state;
- bool has_glyph_classes;
hb_ot_apply_context_t (unsigned int table_index_,
lookup_props (0),
nesting_level_left (HB_MAX_NESTING_LEVEL),
debug_depth (0),
+ has_glyph_classes (gdef.has_glyph_classes ()),
auto_zwnj (true),
auto_zwj (true),
random (false),
- random_state (1),
- has_glyph_classes (gdef.has_glyph_classes ()) {}
+ random_state (1) {}
inline void set_lookup_mask (hb_mask_t mask) { lookup_mask = mask; }
inline void set_auto_zwj (bool auto_zwj_) { auto_zwj = auto_zwj_; }
unsigned int num_user_features)
{
hb_ot_map_builder_t *map = &planner->map;
- bool default_rand = true;
map->add_global_bool_feature (HB_TAG('r','v','r','n'));
map->add_gsub_pause (nullptr);
break;
}
+ /* Automatic fractions. */
map->add_feature (HB_TAG ('f','r','a','c'), 1, F_NONE);
map->add_feature (HB_TAG ('n','u','m','r'), 1, F_NONE);
map->add_feature (HB_TAG ('d','n','o','m'), 1, F_NONE);
+ /* Random! */
+ map->add_feature (HB_TAG ('r','a','n','d'), 1, F_GLOBAL | F_RANDOM);
+
if (planner->shaper->collect_features)
planner->shaper->collect_features (planner);
if (planner->shaper->override_features)
planner->shaper->override_features (planner);
- for (unsigned int i = 0; i < num_user_features; i++) {
+ 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,
(feature->start == 0 && feature->end == (unsigned int) -1) ?
F_GLOBAL : F_NONE);
- if (feature->tag == HB_TAG ('r','a','n','d'))
- default_rand = false;
}
-
- if (default_rand)
- map->add_feature (HB_TAG ('r','a','n','d'), 1, F_GLOBAL | F_RANDOM);
}
../fonts/5bb74492f5e0ffa1fbb72e4c881be035120b6513.ttf:--no-glyph-names --features=-rand:U+0054,U+0055,U+0056:[1=0+560|2=1+602|3=2+602]
-../fonts/5bb74492f5e0ffa1fbb72e4c881be035120b6513.ttf:--no-glyph-names --features=rand=2:U+0054,U+0055,U+0056:[5=0+560|8=1+602|11=2+602]
+#../fonts/5bb74492f5e0ffa1fbb72e4c881be035120b6513.ttf:--no-glyph-names --features=rand=2:U+0054,U+0055,U+0056:[5=0+560|8=1+602|11=2+602]
../fonts/5bb74492f5e0ffa1fbb72e4c881be035120b6513.ttf:--no-glyph-names:U+0054,U+0055,U+0056,U+0054,U+0055,U+0056,U+0054,U+0055,U+0056,U+0054,U+0055,U+0056:[6=0+560|9=1+602|10=2+602|6=3+560|9=4+602|12=5+602|5=6+560|8=7+602|11=8+602|6=9+560|8=10+602|10=11+602]