[subset] Fix unecessary trailing 0 bytes left by ContextFormat2 pruning.
Uneeded rules where beind removed from the count by the bytes for them was being left in the font.
This commit is contained in:
parent
51028e63e6
commit
ff3cac0ccd
|
@ -2411,6 +2411,7 @@ struct ContextFormat2_5
|
|||
const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? c->plan->gsub_lookups : c->plan->gpos_lookups;
|
||||
bool ret = true;
|
||||
int non_zero_index = -1, index = 0;
|
||||
auto snapshot = c->serializer->snapshot();
|
||||
for (const auto& _ : + hb_enumerate (ruleSet)
|
||||
| hb_filter (klass_map, hb_first))
|
||||
{
|
||||
|
@ -2422,8 +2423,10 @@ struct ContextFormat2_5
|
|||
}
|
||||
|
||||
if (coverage_glyph_classes.has (_.first) &&
|
||||
o->serialize_subset (c, _.second, this, lookup_map, &klass_map))
|
||||
o->serialize_subset (c, _.second, this, lookup_map, &klass_map)) {
|
||||
non_zero_index = index;
|
||||
snapshot = c->serializer->snapshot();
|
||||
}
|
||||
|
||||
index++;
|
||||
}
|
||||
|
@ -2437,6 +2440,7 @@ struct ContextFormat2_5
|
|||
out->ruleSet.pop ();
|
||||
index--;
|
||||
}
|
||||
c->serializer->revert (snapshot);
|
||||
|
||||
return_trace (bool (out->ruleSet));
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue