struct FeatureTableSubstitutionRecord
{
- inline const Feature *find_substitute (unsigned int feature_index) const
- {
- if (featureIndex == feature_index)
- return &(this+feature);
- return NULL;
- }
+ friend struct FeatureTableSubstitution;
- inline bool sanitize (hb_sanitize_context_t *c) const
+ inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
{
TRACE_SANITIZE (this);
- return_trace (c->check_struct (this) && feature.sanitize (c, this));
+ return_trace (c->check_struct (this) && feature.sanitize (c, base));
}
protected:
unsigned int count = substitutions.len;
for (unsigned int i = 0; i < count; i++)
{
- const Feature *feature = (this+substitutions.array[i]).find_substitute (feature_index);
- if (feature)
- return feature;
+ const FeatureTableSubstitutionRecord &record = substitutions.array[i];
+ if (record.featureIndex == feature_index)
+ return &(this+record.feature);
}
return NULL;
}
protected:
FixedVersion<> version; /* Version--0x00010000u */
- OffsetArrayOf<FeatureTableSubstitutionRecord, ULONG>
+ ArrayOf<FeatureTableSubstitutionRecord>
substitutions;
public:
DEFINE_SIZE_ARRAY (6, substitutions);
if (FeatureVariations::NOT_FOUND_INDEX != variations_index &&
version.to_int () >= 0x00010001u)
{
- const Feature *feature = (this+featureVars).find_substitute (variations_index, feature_index);
+ const Feature *feature = (this+featureVars).find_substitute (variations_index,
+ feature_index);
if (feature)
return *feature;
}