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

[CheckOutlinesUFO.py] KeyError: missing glyph that, well, is correctly missing #228

Closed
robinsdg opened this issue Jan 4, 2018 · 3 comments

Comments

@robinsdg
Copy link

robinsdg commented Jan 4, 2018

Running checkOutlinesUFO on a specific file throws errors about missing glyphs, and this is sensible, but is it the right behaviour? If something is defined in lib.plist but missing actual data, should it not skip/delete the reference in the flattening process?

$ checkOutlinesUFO -e Regular/font-flat.ufo/
. 
A There is an overlap.
Traceback (most recent call last):
  File "/Users/robin.mientjes/bin/FDK/Tools/osx/../SharedData/FDKScripts/CheckOutlinesUFO.py", line 1004, in <module>
    run(sys.argv[1:])
  File "/Users/robin.mientjes/bin/FDK/Tools/osx/../SharedData/FDKScripts/CheckOutlinesUFO.py", line 932, in run
    skip = fontFile.checkSkipGlyph(glyphName, options.checkAll)
  File "/Users/robin.mientjes/bin/FDK/Tools/osx/../SharedData/FDKScripts/CheckOutlinesUFO.py", line 217, in checkSkipGlyph
    width, outlineXML, skip = self.ufoFontHashData.getOrSkipGlyphXML(glyphName, doAll)
  File "/Users/robin.mientjes/Code/AFDKO/Tools/SharedData/FDKScripts/ufoTools.py", line 689, in getOrSkipGlyphXML
    glyphFileName = self.glyphMap[glyphName]
KeyError: 'A.smcp'
@robinsdg
Copy link
Author

robinsdg commented Jan 4, 2018

This is perhaps not a significant problem for anyone else, I recognise that. I just like to work inside of the makeotf process structure, so that I am more readily prepared for production exports. It also helps me to organise my files better. So a few empty spots where lib.plist says there should be glyphs, but that obviously are missing, should maybe not throw an error but rather just remove the reference from the flattened font.

cjchapman added a commit that referenced this issue Jan 4, 2018
now reporting a warning about skipping a glyph that is not in the UFO glyph map rather than crashing with an error.
@cjchapman
Copy link
Contributor

I agree that this scenario should not cause the code to crash like that.

I just committed a change yesterday that I think will prevent this from happening in the scenario you described, though it will still happen if you specify such a glyph on the command line. The PR (which is merged to the master branch) is here:
https://github.com/adobe-type-tools/afdko/pull/227/files

I've got a proposed fix for the case in which you specify such a glyph on the command line in PR 229:
https://github.com/adobe-type-tools/afdko/pull/229/files
(this one is not merged to the master branch yet, as it is awaiting review)

miguelsousa pushed a commit that referenced this issue Jan 4, 2018
now reporting a warning about skipping a glyph that is not in the UFO glyph map rather than crashing with an error.
@miguelsousa
Copy link
Member

Fixed with #229

schriftgestalt pushed a commit to schriftgestalt/afdko that referenced this issue May 18, 2019
now reporting a warning about skipping a glyph that is not in the UFO glyph map rather than crashing with an error.
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

3 participants