Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[subset/var] subsetting VVAR table fails if VOrgMap non-empty #1516

Closed
blueshade7 opened this issue Feb 22, 2019 · 2 comments
Closed

[subset/var] subsetting VVAR table fails if VOrgMap non-empty #1516

blueshade7 opened this issue Feb 22, 2019 · 2 comments

Comments

@blueshade7
Copy link
Collaborator

Line 1856 - 1857 in fonttools/Lib/fontTools/subset/__init__.py reads:

	if table.VOrgMap:

		table.RsbMap.mapping = {k:varidx_map[v] for k,v in table.RsbMap.mapping.items()}

It should be:

	if table.VOrgMap:
		table.VOrgMap.mapping = {k:varidx_map[v] for k,v in table.VOrgMap.mapping.items()}

Otherwise subsetting VVAR table with non-empty VOrgMap fails as:

Traceback (most recent call last):
  File "/usr/local/bin/pyftsubset", line 11, in <module>
    load_entry_point('fonttools==3.37.4.dev0', 'console_scripts', 'pyftsubset')()
  File "/usr/local/lib/python2.7/site-packages/fonttools-3.37.4.dev0-py2.7.egg/fontTools/misc/loggingTools.py", line 375, in wrapper
    return func(*args, **kwds)
  File "/usr/local/lib/python2.7/site-packages/fonttools-3.37.4.dev0-py2.7.egg/fontTools/subset/__init__.py", line 2827, in main
    subsetter.subset(font)
  File "/usr/local/lib/python2.7/site-packages/fonttools-3.37.4.dev0-py2.7.egg/fontTools/subset/__init__.py", line 2630, in subset
    self._subset_glyphs(font)
  File "/usr/local/lib/python2.7/site-packages/fonttools-3.37.4.dev0-py2.7.egg/fontTools/subset/__init__.py", line 2576, in _subset_glyphs
    retain = table.subset_glyphs(self)
  File "/usr/local/lib/python2.7/site-packages/fonttools-3.37.4.dev0-py2.7.egg/fontTools/subset/__init__.py", line 1857, in subset_glyphs
    table.RsbMap.mapping = {k:varidx_map[v] for k,v in table.RsbMap.mapping.items()}
  File "/usr/local/lib/python2.7/site-packages/fonttools-3.37.4.dev0-py2.7.egg/fontTools/ttLib/tables/otBase.py", line 546, in __getattr__
    raise AttributeError(attr)
@blueshade7
Copy link
Collaborator Author

AdobeVFPrototype.abc_vvar.otf.zip
Test case: mod-copy of AdobeVFPrototype.otf with VVAR table added.

@blueshade7
Copy link
Collaborator Author

AdobeVFPrototype.abc_vvar2.otf.zip
BsbMap had the same problem. Another test case font with BsbMap.

behdad pushed a commit that referenced this issue Feb 23, 2019
* fix #issue 1516: subset VOrgMap

* fixed BsbMap as well

* fix bad edit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants