diff options
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-feat-table.hh')
-rw-r--r-- | Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-feat-table.hh | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-feat-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-feat-table.hh index a20ef864023..c8229940dc0 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-feat-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-aat-layout-feat-table.hh @@ -47,17 +47,16 @@ struct SettingName hb_aat_layout_feature_selector_t get_selector () const { return (hb_aat_layout_feature_selector_t) (unsigned) setting; } - void get_info (hb_aat_layout_feature_selector_info_t *s, - hb_aat_layout_feature_selector_t default_selector) const + hb_aat_layout_feature_selector_info_t get_info (hb_aat_layout_feature_selector_t default_selector) const { - s->name_id = nameIndex; - - s->enable = (hb_aat_layout_feature_selector_t) (unsigned int) setting; - s->disable = default_selector == HB_AAT_LAYOUT_FEATURE_SELECTOR_INVALID ? - (hb_aat_layout_feature_selector_t) (s->enable + 1) : - default_selector; - - s->reserved = 0; + return { + nameIndex, + (hb_aat_layout_feature_selector_t) (unsigned int) setting, + default_selector == HB_AAT_LAYOUT_FEATURE_SELECTOR_INVALID + ? (hb_aat_layout_feature_selector_t) (setting + 1) + : default_selector, + 0 + }; } bool sanitize (hb_sanitize_context_t *c) const @@ -117,9 +116,10 @@ struct FeatureName if (selectors_count) { - hb_array_t<const SettingName> arr = settings_table.sub_array (start_offset, selectors_count); - for (unsigned int i = 0; i < arr.length; i++) - settings_table[start_offset + i].get_info (&selectors[i], default_selector); + + settings_table.sub_array (start_offset, selectors_count) + | hb_map ([=] (const SettingName& setting) { return setting.get_info (default_selector); }) + | hb_sink (hb_array (selectors, *selectors_count)) + ; } return settings_table.length; } @@ -162,21 +162,18 @@ struct feat unsigned int *count, hb_aat_layout_feature_type_t *features) const { - unsigned int feature_count = featureNameCount; - if (count && *count) + if (count) { - unsigned int len = hb_min (feature_count - start_offset, *count); - for (unsigned int i = 0; i < len; i++) - features[i] = namesZ[i + start_offset].get_feature_type (); - *count = len; + + namesZ.as_array (featureNameCount).sub_array (start_offset, count) + | hb_map (&FeatureName::get_feature_type) + | hb_sink (hb_array (features, *count)) + ; } return featureNameCount; } const FeatureName& get_feature (hb_aat_layout_feature_type_t feature_type) const - { - return namesZ.bsearch (featureNameCount, feature_type); - } + { return namesZ.bsearch (featureNameCount, feature_type); } hb_ot_name_id_t get_feature_name_id (hb_aat_layout_feature_type_t feature) const { return get_feature (feature).get_feature_name_id (); } |