batchRoboFontExtension icon indicating copy to clipboard operation
batchRoboFontExtension copied to clipboard

[ds5] Cannot generate static TTF

Open roberto-arista opened this issue 2 years ago • 2 comments

Hey @typemytype, I tried to generate some static TTFs from a designspace and I got the following traceback:

******************************
Traceback (most recent call last):
  File "/Users/robertoarista/Library/Application Support/RoboFont/plugins/Batch.roboFontExt/lib/batchTools.py", line 109, in runTask_
    self._callback(progress=self._progress, **self._kwargs)
  File "/Users/robertoarista/Library/Application Support/RoboFont/plugins/Batch.roboFontExt/lib/batchGenerate/__init__.py", line 146, in run
    result = font.generate(path=path, format=format,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/robertoarista/Documents/Repositories/RF_virtualApp/roboFont.test/roboFont.source/robofont/lib/fontObjects/fontPartsWrappers.py", line 2046, in generate
    return super(RFont, self).generate(format=format, path=path, **environmentOptions)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/robertoarista/Documents/Repositories/RF_virtualApp/roboFont.test/lib/python3.11/site-packages/fontParts/base/font.py", line 367, in generate
    return self._generate(
           ^^^^^^^^^^^^^^^
  File "/Users/robertoarista/Documents/Repositories/RF_virtualApp/roboFont.test/roboFont.source/robofont/lib/fontObjects/fontPartsWrappers.py", line 2130, in _generate
    return self.naked().generate(path=path, format=_format, **environmentOptions)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/robertoarista/Documents/Repositories/RF_virtualApp/roboFont.test/roboFont.source/robofont/lib/fontObjects/doodleFont.py", line 294, in generate
    return self.layers.defaultLayer.generate(path, format, decompose, checkOutlines, autohint,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/robertoarista/Documents/Repositories/RF_virtualApp/roboFont.test/roboFont.source/robofont/lib/fontObjects/doodleLayer.py", line 364, in generate
    result = fontCompilerGenerateFont(self.font, options, outputPath=path, format=format, decompose=decompose,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/robertoarista/Documents/Repositories/RF_virtualApp/roboFont.test/roboFont.source/robofont/fontCompiler/compiler.py", line 149, in generateFont
    reports = compiler.compile(outputFont, options)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/robertoarista/Documents/Repositories/RF_virtualApp/roboFont.test/roboFont.source/robofont/fontCompiler/baseCompiler.py", line 360, in compile
    partsCompiler = self._makeFDKParts(font, options, partsPath, report)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/robertoarista/Documents/Repositories/RF_virtualApp/roboFont.test/roboFont.source/robofont/fontCompiler/ttfCompiler.py", line 549, in _makeFDKParts
    return super()._makeFDKParts(font, options, partsPath, report)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/robertoarista/Documents/Repositories/RF_virtualApp/roboFont.test/roboFont.source/robofont/fontCompiler/baseCompiler.py", line 419, in _makeFDKParts
    partsCompiler.compile()
  File "/Users/robertoarista/Documents/Repositories/RF_virtualApp/roboFont.test/lib/python3.11/site-packages/ufo2fdk/makeotfParts.py", line 93, in compile
    self.setupFile_outlineSource(self.paths["outlineSource"])
  File "/Users/robertoarista/Documents/Repositories/RF_virtualApp/roboFont.test/lib/python3.11/site-packages/ufo2fdk/makeotfParts.py", line 107, in setupFile_outlineSource
    c = self.outlineCompilerClass(self.font, path, self.glyphOrder)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/robertoarista/Documents/Repositories/RF_virtualApp/roboFont.test/roboFont.source/robofont/fontCompiler/baseCompiler.py", line 177, in __init__
    missingRequiredGlyphs = self.makeMissingRequiredGlyphs()
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/robertoarista/Documents/Repositories/RF_virtualApp/roboFont.test/roboFont.source/robofont/fontCompiler/baseCompiler.py", line 201, in makeMissingRequiredGlyphs
    ascender = _roundInt(getAttrWithFallback(font.info, "ascender"))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/robertoarista/Documents/Repositories/RF_virtualApp/roboFont.test/lib/python3.11/site-packages/ufo2fdk/fontInfoData.py", line 545, in getAttrWithFallback
    value = staticFallbackData[attr]
            ~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'ascender'

******************************

I can provide some data if it's useful.

roberto-arista avatar Jul 19 '23 15:07 roberto-arista

is this still an issue?

batch is adding the minimal required font info attributes here https://github.com/typemytype/batchRoboFontExtension/blob/ds5/Batch.roboFontExt/lib/batchGenerators/batchTools.py#L24

typemytype avatar Sep 20 '23 08:09 typemytype

is this is still an issue? if so could you share the designspace and ufos?

thanks!!

typemytype avatar Sep 21 '23 15:09 typemytype