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

Skip over missing components? #16

Closed
brawer opened this issue Feb 16, 2016 · 5 comments
Closed

Skip over missing components? #16

brawer opened this issue Feb 16, 2016 · 5 comments

Comments

@brawer
Copy link
Contributor

brawer commented Feb 16, 2016

When fontmake builds from UFO, what should happen when a glyph refers to an undefined component? Apparently, other build chains are silently skipping over the problem; see metapolator/Breite#1. Instead of crashing, should fontmake perhaps emit a warning and proceed building? Although, nobody looks at warnings, so maybe crashing is fine.

@behdad
Copy link
Contributor

behdad commented Feb 16, 2016

That sounds like a major font bug to me, that we should not hide IMO. I'm
fine if we add an option to "fix-up" issues, but default crash sounds right.

On Tue, Feb 16, 2016 at 6:33 PM, Sascha Brawer notifications@github.com
wrote:

When fontmake builds from UFO, what should happen when a glyph refers to
an undefined component? Apparently, other build chains are silently
skipping over the problem; see metapolator/Breite#1
metapolator/Breite#1. Instead of crashing,
should fontmake perhaps emit a warning and proceed building? Although,
nobody looks at warnings, so maybe crashing is fine.


Reply to this email directly or view it on GitHub
#16.

behdad
http://behdad.org/

@adrientetar
Copy link
Contributor

There should be a warning, at least.

FWIW, ufoLib keeps the missing component and most pens out there just skip missing component (consequently it's not displayed in TruFont for instance). I'm not saying that's optimal behavior but that's how things are currently.

@graphicore
Copy link

@adrientetar Yeah, that was my point in the other issue thread. I think the BasePen of fonttools is the reason/root for this behavior. https://github.com/behdad/fonttools/blob/master/Lib/fontTools/pens/basePen.py#L197 because it is the reference for the segment pen protocol.

@jamesgk
Copy link
Contributor

jamesgk commented Jul 13, 2016

I personally am in favor of crashing in this case. Feel free to comment/re-open if anyone disagrees and wants to continue the discussion.

@jamesgk jamesgk closed this as completed Jul 13, 2016
@typoman
Copy link

typoman commented Mar 3, 2018

I strongly recommend that fontmake should stop building the font and output a Error instead of crashing. Look at the following traceback. It's not easy to dissect that a component is missing. So the user would not know what should be fixed in the UFO.

Traceback (most recent call last):
  File "/usr/local/bin/fontmake", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/fontmake/__main__.py", line 199, in main
    ufo_paths, is_instance=args.pop('masters_as_instances'), **args)
  File "/usr/local/lib/python2.7/site-packages/fontmake/font_project.py", line 476, in run_from_ufos
    ufos, remove_overlaps, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/fontmake/font_project.py", line 166, in build_otfs
    self.decompose_glyphs(ufos)
  File "/usr/local/lib/python2.7/site-packages/fontTools/misc/loggingTools.py", line 372, in wrapper
    return func(*args, **kwds)
  File "/usr/local/lib/python2.7/site-packages/fontmake/font_project.py", line 124, in decompose_glyphs
    self._deep_copy_contours(ufo, glyph, glyph, Transform())
  File "/usr/local/lib/python2.7/site-packages/fontmake/font_project.py", line 132, in _deep_copy_contours
    ufo, parent, ufo[nested.baseGlyph],
  File "/usr/local/lib/python2.7/site-packages/defcon/objects/font.py", line 219, in __getitem__
    return self._glyphSet[name]
  File "/usr/local/lib/python2.7/site-packages/defcon/objects/layer.py", line 261, in __getitem__
    self.loadGlyph(name)
  File "/usr/local/lib/python2.7/site-packages/defcon/objects/layer.py", line 178, in loadGlyph
    raise KeyError("%s not in layer" % name)
KeyError: 'commaAr not in layer'

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

6 participants