diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh index a0b8b5232..dcd4ed1f3 100644 --- a/src/hb-ot-layout-common-private.hh +++ b/src/hb-ot-layout-common-private.hh @@ -313,11 +313,29 @@ struct Lookup return flag; } + inline bool serialize (hb_serialize_context_t *c, + unsigned int lookup_type, + uint32_t lookup_props, + unsigned int num_subtables) + { + TRACE_SERIALIZE (); + if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false); + lookupType.set (lookup_type); + lookupFlag.set (lookup_props & 0xFFFF); + if (unlikely (!subTable.serialize (c, num_subtables))) return TRACE_RETURN (false); + if ((lookup_props >> 16) || lookupFlag & LookupFlag::UseMarkFilteringSet) + { + USHORT &markFilteringSet = StructAfter (subTable); + markFilteringSet.set (lookup_props >> 16); + } + return TRACE_RETURN (true); + } + inline bool sanitize (hb_sanitize_context_t *c) { TRACE_SANITIZE (); /* Real sanitize of the subtables is done by GSUB/GPOS/... */ if (!(c->check_struct (this) && subTable.sanitize (c))) return TRACE_RETURN (false); - if (unlikely (lookupFlag & LookupFlag::UseMarkFilteringSet)) + if (lookupFlag & LookupFlag::UseMarkFilteringSet) { USHORT &markFilteringSet = StructAfter (subTable); if (!markFilteringSet.sanitize (c)) return TRACE_RETURN (false);