Fix partial disabling of default-on features Surprisingly, if user ever tried to turn a default feature off partially (say, disable liga for a range), the feature was being turned off globally! Fixed now.
diff --git a/src/hb-ot-map.cc b/src/hb-ot-map.cc index 2fbb6ce..28a43a4 100644 --- a/src/hb-ot-map.cc +++ b/src/hb-ot-map.cc
@@ -194,11 +194,11 @@ } else { feature_infos[j].flags &= ~F_GLOBAL; feature_infos[j].max_value = MAX (feature_infos[j].max_value, feature_infos[i].max_value); + /* Inherit default_value from j */ } feature_infos[j].flags |= (feature_infos[i].flags & F_HAS_FALLBACK); feature_infos[j].stage[0] = MIN (feature_infos[j].stage[0], feature_infos[i].stage[0]); feature_infos[j].stage[1] = MIN (feature_infos[j].stage[1], feature_infos[i].stage[1]); - /* Inherit default_value from j */ } feature_infos.shrink (j + 1); } @@ -252,8 +252,7 @@ map->shift = next_bit; map->mask = (1 << (next_bit + bits_needed)) - (1 << next_bit); next_bit += bits_needed; - if ((info->flags & F_GLOBAL)) - m.global_mask |= (info->default_value << map->shift) & map->mask; + m.global_mask |= (info->default_value << map->shift) & map->mask; } map->_1_mask = (1 << map->shift) & map->mask; map->needs_fallback = !found;