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
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;
}
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;
}
struct LayerRecord
{
+ operator hb_ot_color_layer_t () const { return {glyphId, colorIdx}; }
+
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this));
}
- public:
+ protected:
GlyphID glyphId; /* Glyph ID of layer glyph */
Index colorIdx; /* Index value to use with a
* selected color palette.
record.numLayers);
if (count)
{
- hb_array_t<const LayerRecord> segment_layers = glyph_layers.sub_array (start_offset, *count);
- *count = segment_layers.length;
- for (unsigned int i = 0; i < segment_layers.length; i++)
- {
- layers[i].glyph = segment_layers.arrayZ[i].glyphId;
- layers[i].color_index = segment_layers.arrayZ[i].colorIdx;
- }
+ + glyph_layers.sub_array (start_offset, count)
+ | hb_sink (hb_array (layers, *count))
+ ;
}
return glyph_layers.length;
}
{
if (count)
{
- hb_array_t<const DataMap> arr = table->dataMaps.sub_array (start_offset, count);
- for (unsigned int i = 0; i < arr.length; i++)
- entries[i] = (hb_ot_meta_tag_t) arr[i].get_tag ();
+ + table->dataMaps.sub_array (start_offset, count)
+ | hb_map (&DataMap::get_tag)
+ | hb_map ([](hb_tag_t tag) { return (hb_ot_meta_tag_t) tag; })
+ | hb_sink (hb_array (entries, *count))
+ ;
}
return table->dataMaps.len;
}