[subset] add comment for why we retain empty lookups.

This commit is contained in:
Garret Rieger 2022-10-21 22:37:32 +00:00 committed by Behdad Esfahbod
parent 70e2de2bd4
commit 83769b9cb1
1 changed files with 6 additions and 0 deletions

View File

@ -1388,6 +1388,12 @@ struct Lookup
outMarkFilteringSet = markFilteringSet;
}
// Always keep the lookup even if it's empty. The rest of layout subsetting depends on lookup
// indices being consistent with those computed during planning. So if an empty lookup is
// discarded during the subset phase it will invalidate all subsequent lookup indices.
// Generally we shouldn't end up with an empty lookup as we pre-prune them during the planning
// phase, but it can happen in rare cases such as when during closure subtable is considered
// degenerate (see: https://github.com/harfbuzz/harfbuzz/issues/3853)
return true;
}