[subset] don't set lookup visited in closure_lookups_context_t::recurse.
- Lookup::closure_lookups also checks if the lookups visited and sets the lookup to visited. If we set visited in 'recurse' then Lookup::closure_lookups will fail to recurse into the children of the lookup. - Also when copying ChainRule's skip LookupRecord's that point to lookups which aren't retained. This matches FontTool's behaviour.
This commit is contained in:
parent
feeff5928b
commit
8f47dd5779
|
@ -146,7 +146,6 @@ struct hb_closure_lookups_context_t :
|
|||
if (is_lookup_visited (lookup_index))
|
||||
return;
|
||||
|
||||
set_lookup_visited (lookup_index);
|
||||
nesting_level_left--;
|
||||
recurse_func (this, lookup_index);
|
||||
nesting_level_left++;
|
||||
|
@ -2328,12 +2327,19 @@ struct ChainRule
|
|||
| hb_map (mapping));
|
||||
|
||||
const ArrayOf<LookupRecord> &lookupRecord = StructAfter<ArrayOf<LookupRecord>> (lookahead);
|
||||
HBUINT16 lookupCount;
|
||||
lookupCount = lookupRecord.len;
|
||||
if (!c->copy (lookupCount)) return_trace (nullptr);
|
||||
|
||||
for (unsigned i = 0; i < (unsigned) lookupCount; i++)
|
||||
HBUINT16* lookupCount = c->embed (&(lookupRecord.len));
|
||||
if (!lookupCount) return_trace (nullptr);
|
||||
|
||||
for (unsigned i = 0; i < lookupRecord.len; i++)
|
||||
{
|
||||
if (!lookup_map->has (lookupRecord[i].lookupListIndex))
|
||||
{
|
||||
(*lookupCount)--;
|
||||
continue;
|
||||
}
|
||||
if (!c->copy (lookupRecord[i], lookup_map)) return_trace (nullptr);
|
||||
}
|
||||
|
||||
return_trace (out);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue