[subset] ChainContextFormat3 - don't subset glyph sequences.
The backtrack, input, and lookahead sequence must be matched in their entirety so these sequences should not be subset. If any of the coverage tables in a sequence subsets to empty then the whole subtable should be dropped since it's not possible for this lookup to be activated.
This commit is contained in:
parent
e31c2690f8
commit
940e1c6f98
|
@ -3038,20 +3038,21 @@ struct ChainContextFormat3
|
||||||
|
|
||||||
template<typename Iterator,
|
template<typename Iterator,
|
||||||
hb_requires (hb_is_iterator (Iterator))>
|
hb_requires (hb_is_iterator (Iterator))>
|
||||||
OffsetArrayOf<Coverage>* serialize_coverage_offsets
|
bool serialize_coverage_offsets (hb_subset_context_t *c, Iterator it, const void* base) const
|
||||||
(hb_subset_context_t *c, Iterator it, const void* base) const
|
|
||||||
{
|
{
|
||||||
TRACE_SERIALIZE (this);
|
TRACE_SERIALIZE (this);
|
||||||
auto *out = c->serializer->start_embed<OffsetArrayOf<Coverage>> ();
|
auto *out = c->serializer->start_embed<OffsetArrayOf<Coverage>> ();
|
||||||
|
|
||||||
if (unlikely (!c->serializer->allocate_size<HBUINT16> (HBUINT16::static_size)))
|
if (unlikely (!c->serializer->allocate_size<HBUINT16> (HBUINT16::static_size)))
|
||||||
return_trace (nullptr);
|
return_trace (false);
|
||||||
|
|
||||||
+ it
|
for (auto& offset : it) {
|
||||||
| hb_apply (subset_offset_array (c, *out, base))
|
auto *o = out->serialize_append (c->serializer);
|
||||||
;
|
if (unlikely (!o) || !o->serialize_subset (c, offset, base))
|
||||||
|
return_trace (false);
|
||||||
|
}
|
||||||
|
|
||||||
return_trace (out);
|
return_trace (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool subset (hb_subset_context_t *c) const
|
bool subset (hb_subset_context_t *c) const
|
||||||
|
@ -3066,8 +3067,7 @@ struct ChainContextFormat3
|
||||||
return_trace (false);
|
return_trace (false);
|
||||||
|
|
||||||
const OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage>> (backtrack);
|
const OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage>> (backtrack);
|
||||||
OffsetArrayOf<Coverage>* new_coverage = serialize_coverage_offsets (c, input.iter (), this);
|
if (!serialize_coverage_offsets (c, input.iter (), this))
|
||||||
if (!new_coverage || !new_coverage->len)
|
|
||||||
return_trace (false);
|
return_trace (false);
|
||||||
|
|
||||||
const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage>> (input);
|
const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage>> (input);
|
||||||
|
|
Loading…
Reference in New Issue