Fix for subsetting HVAR tables that have an AdvanceWidthMap when the --retain-gid option is used. Needed to make subset_test.py::test_retain_gids_cff2 tests pass.
This commit is contained in:
parent
1cb9b81861
commit
635537604d
@ -1798,17 +1798,20 @@ def subset_glyphs(self, s):
|
|||||||
used = set()
|
used = set()
|
||||||
|
|
||||||
if table.AdvWidthMap:
|
if table.AdvWidthMap:
|
||||||
table.AdvWidthMap.mapping = _dict_subset(table.AdvWidthMap.mapping, s.glyphs)
|
if not s.options.retain_gids:
|
||||||
|
table.AdvWidthMap.mapping = _dict_subset(table.AdvWidthMap.mapping, s.glyphs)
|
||||||
used.update(table.AdvWidthMap.mapping.values())
|
used.update(table.AdvWidthMap.mapping.values())
|
||||||
else:
|
else:
|
||||||
assert table.LsbMap is None and table.RsbMap is None, "File a bug."
|
assert table.LsbMap is None and table.RsbMap is None, "File a bug."
|
||||||
used.update(s.reverseOrigGlyphMap.values())
|
used.update(s.reverseOrigGlyphMap.values())
|
||||||
|
|
||||||
if table.LsbMap:
|
if table.LsbMap:
|
||||||
table.LsbMap.mapping = _dict_subset(table.LsbMap.mapping, s.glyphs)
|
if not s.options.retain_gids:
|
||||||
|
table.LsbMap.mapping = _dict_subset(table.LsbMap.mapping, s.glyphs)
|
||||||
used.update(table.LsbMap.mapping.values())
|
used.update(table.LsbMap.mapping.values())
|
||||||
if table.RsbMap:
|
if table.RsbMap:
|
||||||
table.RsbMap.mapping = _dict_subset(table.RsbMap.mapping, s.glyphs)
|
if not s.options.retain_gids:
|
||||||
|
table.RsbMap.mapping = _dict_subset(table.RsbMap.mapping, s.glyphs)
|
||||||
used.update(table.RsbMap.mapping.values())
|
used.update(table.RsbMap.mapping.values())
|
||||||
|
|
||||||
varidx_map = varStore.VarStore_subset_varidxes(table.VarStore, used)
|
varidx_map = varStore.VarStore_subset_varidxes(table.VarStore, used)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user