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] VVAR fails to subset with --retain-gids #1552

Closed
blueshade7 opened this issue Mar 21, 2019 · 1 comment
Closed

[subset] VVAR fails to subset with --retain-gids #1552

blueshade7 opened this issue Mar 21, 2019 · 1 comment

Comments

@blueshade7
Copy link
Collaborator

A variable font with VVAR table fails to subset with --retain-gids option.

Font file attached:
SourceSerifVariable-Roman-VVAR.abc.ttf.zip

% pyftsubset SourceSerifVariable-Roman-VVAR.abc.ttf --text=ac --retain-gids --output-file=output.ttf
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/bin/pyftsubset", line 11, in <module>
    load_entry_point('fonttools==3.39.1.dev0', 'console_scripts', 'pyftsubset')()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fonttools-3.39.1.dev0-py2.7.egg/fontTools/misc/loggingTools.py", line 375, in wrapper
    return func(*args, **kwds)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fonttools-3.39.1.dev0-py2.7.egg/fontTools/subset/__init__.py", line 2832, in main
    save_font(font, outfile, options)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fonttools-3.39.1.dev0-py2.7.egg/fontTools/misc/loggingTools.py", line 375, in wrapper
    return func(*args, **kwds)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fonttools-3.39.1.dev0-py2.7.egg/fontTools/subset/__init__.py", line 2679, in save_font
    font.save(outfile, reorderTables=options.canonical_order)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fonttools-3.39.1.dev0-py2.7.egg/fontTools/ttLib/ttFont.py", line 173, in save
    writer_reordersTables = self._save(tmp)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fonttools-3.39.1.dev0-py2.7.egg/fontTools/ttLib/ttFont.py", line 212, in _save
    self._writeTable(tag, writer, done, tableCache)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fonttools-3.39.1.dev0-py2.7.egg/fontTools/ttLib/ttFont.py", line 633, in _writeTable
    tabledata = self.getTableData(tag)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fonttools-3.39.1.dev0-py2.7.egg/fontTools/ttLib/ttFont.py", line 651, in getTableData
    return self.tables[tag].compile(self)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fonttools-3.39.1.dev0-py2.7.egg/fontTools/ttLib/tables/otBase.py", line 70, in compile
    self.table.compile(writer, font)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fonttools-3.39.1.dev0-py2.7.egg/fontTools/ttLib/tables/otBase.py", line 709, in compile
    conv.write(writer, font, table, value)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fonttools-3.39.1.dev0-py2.7.egg/fontTools/ttLib/tables/otConverters.py", line 520, in write
    value.compile(subWriter, font)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fonttools-3.39.1.dev0-py2.7.egg/fontTools/ttLib/tables/otBase.py", line 649, in compile
    table = self.preWrite(font)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fonttools-3.39.1.dev0-py2.7.egg/fontTools/ttLib/tables/otTables.py", line 632, in preWrite
    mapping = [mapping[g] for g in glyphOrder]
KeyError: ('b', 'VarIdxMap')
@readroberts
Copy link
Collaborator

I suspect that this just needs the same fix as was applied for HVAR in commit 6355376 on March 19.

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