Move the iteration logic to FeatureParamsCharacterVariants

Hopefully I can make members protected also.
pull/2476/head
Ebrahim Byagowi 5 years ago
parent 9b3d4f457e
commit d38eb49f46
  1. 12
      src/hb-ot-layout-common.hh
  2. 15
      src/hb-ot-layout.cc

@ -805,6 +805,18 @@ struct FeatureParamsStylisticSet
/* https://docs.microsoft.com/en-us/typography/opentype/spec/features_ae#cv01-cv99 */
struct FeatureParamsCharacterVariants
{
unsigned
get_characters (unsigned start_offset, unsigned *char_count, hb_codepoint_t *chars) const
{
if (char_count)
{
+ characters.sub_array (start_offset, char_count)
| hb_sink (hb_array (chars, *char_count))
;
}
return characters.len;
}
unsigned get_size () const
{ return min_size + characters.len * HBUINT24::static_size; }

@ -1723,17 +1723,10 @@ hb_ot_layout_feature_get_characters (hb_face_t *face,
hb_codepoint_t *characters /* OUT. May be NULL */)
{
const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
auto &cv_params = g.get_feature (feature_index)
.get_feature_params ()
.get_character_variants_params(g.get_feature_tag (feature_index));
if (char_count)
{
+ cv_params.characters.sub_array (start_offset, char_count)
| hb_sink (hb_array (characters, *char_count))
;
}
return cv_params.characters.len;
return g.get_feature (feature_index)
.get_feature_params ()
.get_character_variants_params(g.get_feature_tag (feature_index))
.get_characters (start_offset, char_count, characters);
}
#endif

Loading…
Cancel
Save