提交 652d1e0d 编写于 作者: B Behdad Esfahbod

[OT] Start adding Lookup-level serialize API

上级 a930c68e
......@@ -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<USHORT> (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<USHORT> (subTable);
if (!markFilteringSet.sanitize (c)) return TRACE_RETURN (false);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册