[subset] Sketch GDEF subsetting

This commit is contained in:
Behdad Esfahbod 2018-12-13 18:10:48 -05:00
parent 705e2f5056
commit 1b6d0c44b3
2 changed files with 22 additions and 0 deletions

View File

@ -438,6 +438,26 @@ struct GDEF
(version.to_int () >= 0x00010003u ? varStore.static_size : 0); (version.to_int () >= 0x00010003u ? varStore.static_size : 0);
} }
inline bool subset (hb_subset_context_t *c) const
{
TRACE_SUBSET (this);
struct GDEF *out = c->serializer->embed (*this);
if (unlikely (!out)) return_trace (false);
out->glyphClassDef.serialize_subset (c, this+glyphClassDef, out);
out->attachList.set (0);//TODO(subset) serialize_subset (c, this+attachList, out);
out->ligCaretList.set (0);//TODO(subset) serialize_subset (c, this+ligCaretList, out);
out->markAttachClassDef.serialize_subset (c, this+markAttachClassDef, out);
if (version.to_int () >= 0x00010002u)
out->markGlyphSetsDef.set (0);// TODO(subset) serialize_subset (c, this+markGlyphSetsDef, out);
if (version.to_int () >= 0x00010003u)
out->varStore.set (0);// TODO(subset) serialize_subset (c, this+varStore, out);
return_trace (true);
}
inline bool sanitize (hb_sanitize_context_t *c) const inline bool sanitize (hb_sanitize_context_t *c) const
{ {
TRACE_SANITIZE (this); TRACE_SANITIZE (this);

View File

@ -2710,6 +2710,7 @@ struct GSUBGPOS
TRACE_SUBSET (this); TRACE_SUBSET (this);
struct GSUBGPOS *out = c->serializer->embed (*this); struct GSUBGPOS *out = c->serializer->embed (*this);
if (unlikely (!out)) return_trace (false); if (unlikely (!out)) return_trace (false);
out->scriptList.serialize_subset (c, this+scriptList, out); out->scriptList.serialize_subset (c, this+scriptList, out);
out->featureList.serialize_subset (c, this+featureList, out); out->featureList.serialize_subset (c, this+featureList, out);
@ -2722,6 +2723,7 @@ struct GSUBGPOS
if (version.to_int () >= 0x00010001u) if (version.to_int () >= 0x00010001u)
out->featureVars.serialize_subset (c, this+featureVars, out); out->featureVars.serialize_subset (c, this+featureVars, out);
return_trace (true); return_trace (true);
} }