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

skipExportGlyphs regression in 2.18.0 #432

Closed
kontur opened this issue Nov 25, 2020 · 3 comments · Fixed by #434
Closed

skipExportGlyphs regression in 2.18.0 #432

kontur opened this issue Nov 25, 2020 · 3 comments · Fixed by #434

Comments

@kontur
Copy link
Contributor

kontur commented Nov 25, 2020

Following up to the release of 2.18.0 and the solution to not include skipExportGlyphs in the feature writer I am getting KeyErrors for the non-exporting glyphs.

  File "/Users/johannes/Packages/ufo2ft/Lib/ufo2ft/featureWriters/baseFeatureWriter.py", line 110, in write
    self.setContext(font, feaFile, compiler=compiler)
  File "/Users/johannes/Packages/ufo2ft/Lib/ufo2ft/featureWriters/kernFeatureWriter.py", line 211, in setContext
    ctx.kerning = self.getKerningData(font, feaFile, self.getOrderedGlyphSet())
  File "/Users/johannes/Packages/ufo2ft/Lib/ufo2ft/featureWriters/baseFeatureWriter.py", line 161, in getOrderedGlyphSet
    return OrderedDict((gn, glyphSet[gn]) for gn in glyphOrder)
  File "/Users/johannes/Packages/ufo2ft/Lib/ufo2ft/featureWriters/baseFeatureWriter.py", line 161, in <genexpr>
    return OrderedDict((gn, glyphSet[gn]) for gn in glyphOrder)
KeyError: '_part.markGaf'

If I understand correctly, this code here tries to create a new dict that includes everything in the glyphOrder.

I am not sure if this is caused by the way I am extracting the UFOs from .glyphs sources via glyphsLib or if this applicable to all UFOs. Either way, the UFO's glyphs/contents.plist does contain the non-exporting glyphs, so even though glyphSet is filtered by the skipExportGlyphs attribute, the following OrderedDict creation does try access the glyphOrder index of the non-exporting glyphs that have been pruned from glyphSet, and thus raises the error.

kontur added a commit to kontur/ufo2ft that referenced this issue Nov 25, 2020
… results in KeyError for non-exporting glyphs
@anthrotype
Copy link
Member

Thanks for the report and the PR. I have a similar fix coming, stay tuned

@anthrotype
Copy link
Member

released v2.18.1 with the fix => https://pypi.org/project/ufo2ft/2.18.1

@kontur
Copy link
Contributor Author

kontur commented Nov 25, 2020

Thanks for the quick action. Ah, I see, there's a more convenient way already in the method signature! Good to include a test 👍

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

Successfully merging a pull request may close this issue.

2 participants