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

[makeinstancesufo] fail better when source files are missing #778

Closed
frankrolf opened this issue Mar 25, 2019 · 1 comment
Closed

[makeinstancesufo] fail better when source files are missing #778

frankrolf opened this issue Mar 25, 2019 · 1 comment

Comments

@frankrolf
Copy link
Member

File this under “unexpected problems found during FDK workshop”:

When one of the masters is missing on disk, makeinstancesufo will fail like this:

Masters$ makeinstancesufo -acnv -d Exercise3.designspace 
INFO:afdko.makeinstancesufo:Reading design space file 'Exercise3.designspace' ...
INFO:afdko.makeinstancesufo:Adding Exercise 3 Regular to build list.
INFO:afdko.makeinstancesufo:Adding Exercise 3 Bold to build list.
INFO:afdko.makeinstancesufo:Adding Exercise 3 SemiBold to build list.
INFO:afdko.makeinstancesufo:Building 3 instances...
ERROR:afdko.makeinstancesufo:ufoProcessor error
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/ufoProcessor/__init__.py", line 117, in build
    r = document.generateUFO(processRules=processRules)
  File "/usr/local/lib/python3.7/site-packages/ufoProcessor/__init__.py", line 299, in generateUFO
    font = self.makeInstance(instanceDescriptor, processRules, glyphNames=glyphNames, pairs=pairs, bend=bend)
  File "/usr/local/lib/python3.7/site-packages/ufoProcessor/__init__.py", line 625, in makeInstance
    kerningMutator = self.getKerningMutator()
  File "/usr/local/lib/python3.7/site-packages/ufoProcessor/__init__.py", line 403, in getKerningMutator
    bias, self._kerningMutator = self.getVariationModel(kerningItems, axes=self.serializedAxes, bias=self.defaultLoc)
TypeError: cannot unpack non-iterable NoneType object
INFO:afdko.makeinstancesufo:Built 3 instances.
Traceback (most recent call last):
  File "/usr/local/bin/makeinstancesufo", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/afdko/makeinstancesufo.py", line 388, in main
    run(opts)
  File "/usr/local/lib/python3.7/site-packages/afdko/makeinstancesufo.py", line 243, in run
    postProcessInstance(instancePath, options)
  File "/usr/local/lib/python3.7/site-packages/afdko/makeinstancesufo.py", line 210, in postProcessInstance
    dFont = Font(fontPath)
  File "/usr/local/lib/python3.7/site-packages/defcon/objects/font.py", line 148, in __init__
    reader = UFOReader(self._path, validate=self.ufoLibReadValidate)
  File "/usr/local/lib/python3.7/site-packages/fontTools/ufoLib/__init__.py", line 209, in __init__
    structure = _sniffFileStructure(path)
  File "/usr/local/lib/python3.7/site-packages/fontTools/ufoLib/__init__.py", line 1605, in _sniffFileStructure
    raise UFOLibError("No such file or directory: '%s'" % ufo_path)
fontTools.ufoLib.errors.UFOLibError: No such file or directory: '../Instances/Regular/font.ufo'

Perhaps it should fail earlier and clearer, during a global check to see if all source UFOs exist?

@frankrolf frankrolf changed the title [makeinstancesufo] odd problems [makeinstancesufo] Fail better when source files are missing Mar 25, 2019
@frankrolf frankrolf changed the title [makeinstancesufo] Fail better when source files are missing [makeinstancesufo] fail better when source files are missing Mar 25, 2019
@miguelsousa
Copy link
Member

Fixed via #821

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

No branches or pull requests

2 participants