question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Compiling UFO failed: <fontTools.feaLib.ast.GlyphName object at 0x10ea35b10>" with FontTools==4.35.0

See original GitHub issue

I’m trying to build static OTFs from a Glyphs source, and getting the error traceback when I use --verbose DEBUG:

ERROR:root:In 'sources/shantellsans-wght_ital_IRGL.glyphs' -> 'master_ufo/ShantellSans.designspace' -> 'master_ufo/shantell--light.ufo': Compiling UFO failed: <fontTools.feaLib.ast.GlyphName object at 0x10ea35b10>
Traceback (most recent call last):
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/fontmake/font_project.py", line 439, in _iter_compile
    yield compile_func(ufo, debugFeatureFile=debugFeatureFile, **options)
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/ufo2ft/__init__.py", line 193, in compileOTF
    compileFeatures(ufo, otf, glyphSet=glyphSet, **kwargs)
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/ufo2ft/__init__.py", line 507, in compileFeatures
    otFont = featureCompiler.compile()
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/ufo2ft/featureCompiler.py", line 127, in compile
    self.setupFeatures()
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/ufo2ft/featureCompiler.py", line 265, in setupFeatures
    writer.write(self.ufo, featureFile, compiler=self)
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/ufo2ft/featureWriters/baseFeatureWriter.py", line 131, in write
    return self._write()
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/ufo2ft/featureWriters/cursFeatureWriter.py", line 119, in _write
    feature = self._makeCursiveFeature()
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/ufo2ft/featureWriters/cursFeatureWriter.py", line 26, in _makeCursiveFeature
    gsub = self.compileGSUB()
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/ufo2ft/featureWriters/baseFeatureWriter.py", line 321, in compileGSUB
    gsub = compileGSUB(self.context.feaFile, glyphOrder)
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/ufo2ft/util.py", line 230, in compileGSUB
    addOpenTypeFeatures(font, featureFile, tables={"GSUB"})
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/fontTools/feaLib/builder.py", line 64, in addOpenTypeFeatures
    builder.build(tables=tables, debug=debug)
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/fontTools/feaLib/builder.py", line 227, in build
    gdef = self.buildGDEF()  # build unconditionally so we can warn below
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/fontTools/feaLib/builder.py", line 763, in buildGDEF
    gdef.MarkGlyphSetsDef = self.buildGDEFMarkGlyphSetsDef_()
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/fontTools/feaLib/builder.py", line 822, in buildGDEFMarkGlyphSetsDef_
    return otl.buildMarkGlyphSetsDef(sets, self.glyphMap)
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/fontTools/otlLib/builder.py", line 2618, in buildMarkGlyphSetsDef
    self.Coverage = [buildCoverage(m, glyphMap) for m in markSets]
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/fontTools/otlLib/builder.py", line 2618, in <listcomp>
    self.Coverage = [buildCoverage(m, glyphMap) for m in markSets]
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/fontTools/otlLib/builder.py", line 58, in buildCoverage
    self.glyphs = sorted(set(glyphs), key=glyphMap.__getitem__)
KeyError: <fontTools.feaLib.ast.GlyphName object at 0x10ea35b10>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/fontmake/__main__.py", line 620, in main
    project.run_from_glyphs(inputs.glyphs_path, **args)
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/fontmake/font_project.py", line 787, in run_from_glyphs
    self.run_from_designspace(designspace_path, **kwargs)
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/fontmake/font_project.py", line 1051, in run_from_designspace
    self._run_from_designspace_static(
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/fontmake/font_project.py", line 1135, in _run_from_designspace_static
    self.run_from_ufos(
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/fontmake/font_project.py", line 1217, in run_from_ufos
    self.build_otfs(ufos, cff_version=cff_version, **kwargs)
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/fontmake/font_project.py", line 247, in build_otfs
    self.save_otfs(ufos, **kwargs)
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/fontTools/misc/loggingTools.py", line 372, in wrapper
    return func(*args, **kwds)
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/fontmake/font_project.py", line 580, in save_otfs
    for font, ufo in zip(fonts, ufos):
  File "/Users/stephennixon/type-repos/shantell-sans/venv/lib/python3.10/site-packages/fontmake/font_project.py", line 441, in _iter_compile
    raise FontmakeError("Compiling UFO failed", ufo.path) from e
fontmake.errors.FontmakeError: In 'sources/shantellsans-wght_ital_IRGL.glyphs' -> 'master_ufo/ShantellSans.designspace' -> 'master_ufo/shantell--light.ufo': Compiling UFO failed: <fontTools.feaLib.ast.GlyphName object at 0x10ea35b10>

I’ve tried commenting out all feature code in the problem UFO, but that doesn’t seem to correct this.

The build does work with fonttools==4.34.4, but then I get this as a warning:

WARNING:fontTools.ttLib.tables.otBase:hb.repack failed to serialize 'GPOS', attempting fonttools resolutions ; the error message was: RepackerError

Is there some way I can determine if an incorrect glyph name is blocking this build? Should I instead be filing this issue with FontTools?

Thank you for any insights!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
anthrotypecommented, Aug 18, 2022

can you please retry using fonttools==4.36.0? it contains https://github.com/fonttools/fonttools/pull/2744 which works around this issue

0reactions
arrowtypecommented, Aug 22, 2022

FontTools 4.36.0 seems to work perfectly here! Thanks to you, Just, and Simon for working that out!

Read more comments on GitHub >

github_iconTop Results From Across the Web

version 4.35.0 breaks our tests in gftools · Issue #2747 - GitHub
ERROR:root:In 'Lora.glyphs' -> 'master_ufo/Lora.designspace': Generating fonts from Designspace failed: <fontTools.feaLib.ast.GlyphName ...
Read more >
feaLib: Read/write OpenType feature files - fontTools
In the below, a glyph-containing object is an object of one of the following classes: GlyphName , GlyphClass , GlyphClassName . class fontTools.feaLib.ast....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found