[subset] Fix serialize_subset() calls

Ouch.
pull/1151/head
Behdad Esfahbod 6 years ago
parent 7c9cfa2b40
commit 49c44b58f6
  1. 2
      src/hb-open-type.hh
  2. 6
      src/hb-ot-layout-common.hh
  3. 13
      src/hb-ot-layout-gsub-table.hh
  4. 6
      src/hb-ot-layout-gsubgpos.hh

@ -525,7 +525,7 @@ struct OffsetListOf : OffsetArrayOf<Type>
if (unlikely (!out)) return_trace (false);
unsigned int count = this->len;
for (unsigned int i = 0; i < count; i++)
out->arrayZ[i].serialize_subset (c, (*this)[i], this);
out->arrayZ[i].serialize_subset (c, (*this)[i], out);
return_trace (true);
}

@ -144,7 +144,7 @@ struct RecordListOf : RecordArrayOf<Type>
if (unlikely (!out)) return_trace (false);
unsigned int count = this->len;
for (unsigned int i = 0; i < count; i++)
out->get_offset (i).serialize_subset (c, (*this)[i], this);
out->get_offset (i).serialize_subset (c, (*this)[i], out);
return_trace (true);
}
@ -283,10 +283,10 @@ struct Script
TRACE_SUBSET (this);
struct Script *out = c->serializer->embed (*this);
if (unlikely (!out)) return_trace (false);
out->defaultLangSys.serialize_subset (c, this+defaultLangSys, this);
out->defaultLangSys.serialize_subset (c, this+defaultLangSys, out);
unsigned int count = langSys.len;
for (unsigned int i = 0; i < count; i++)
out->langSys.arrayZ[i].offset.serialize_subset (c, this+langSys[i].offset, this);
out->langSys.arrayZ[i].offset.serialize_subset (c, this+langSys[i].offset, out);
return_trace (true);
}

@ -1402,14 +1402,13 @@ struct GSUB : GSUBGPOS
inline bool subset (hb_subset_context_t *c) const
{
TRACE_SUBSET (this);
//struct GSUB *out = c->serializer->start_embed<GSUB> ();
struct GSUB *out = c->serializer->start_embed<GSUB> ();
if (unlikely (!GSUBGPOS::subset (c))) return_trace (false);
/* TODO Replace following with c->iter_copy_and_subset()ish. */
unsigned int count = get_lookup_count ();
//LookupList &outLookupList = out+out->lookupList;
for (unsigned int i = 0; i < count; i++)
//XXX if (unlikely (!outLookupList.arrayZ[i].subset (c, get_lookup (i), &outLookupList)))
return_trace (false);
const OffsetTo<SubstLookupList> &list = CastR<const OffsetTo<SubstLookupList> > (lookupList);
OffsetTo<SubstLookupList> &outList = CastR<OffsetTo<SubstLookupList> > (out->lookupList);
outList.set (0);
//outList.serialize_subset (c, this+list, out);
/* TODO Use intersects() to count how many subtables survive? */
return_trace (true);
}

@ -2551,11 +2551,11 @@ struct GSUBGPOS
TRACE_SUBSET (this);
struct GSUBGPOS *out = c->serializer->embed (*this);
if (unlikely (!out)) return_trace (false);
out->scriptList.serialize_subset (c, this+scriptList, this);
out->featureList.serialize_subset (c, this+featureList, this);
out->scriptList.serialize_subset (c, this+scriptList, out);
out->featureList.serialize_subset (c, this+featureList, out);
out->lookupList.set (0); /* GSUB/GPOS fill this one in. */
if (version.to_int () >= 0x00010001u)
out->featureVars.serialize_subset (c, this+featureVars, this);
out->featureVars.serialize_subset (c, this+featureVars, out);
return_trace (true);
}

Loading…
Cancel
Save