{"action":"created","issue":{"url":"https://api.github.com/repos/LettError/MutatorMath/issues/58","repository_url":"https://api.github.com/repos/LettError/MutatorMath","labels_url":"https://api.github.com/repos/LettError/MutatorMath/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/LettError/MutatorMath/issues/58/comments","events_url":"https://api.github.com/repos/LettError/MutatorMath/issues/58/events","html_url":"https://github.com/LettError/MutatorMath/issues/58","id":185021578,"number":58,"title":"Interpolating Ubuntu Mono fails with \"Errors calculating 427 glyphs\" due to IndexError in \"fontMath/mathGlyph.py\"","user":{"login":"cpitclaudel","id":8181630,"avatar_url":"https://avatars.githubusercontent.com/u/8181630?v=3","gravatar_id":"","url":"https://api.github.com/users/cpitclaudel","html_url":"https://github.com/cpitclaudel","followers_url":"https://api.github.com/users/cpitclaudel/followers","following_url":"https://api.github.com/users/cpitclaudel/following{/other_user}","gists_url":"https://api.github.com/users/cpitclaudel/gists{/gist_id}","starred_url":"https://api.github.com/users/cpitclaudel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpitclaudel/subscriptions","organizations_url":"https://api.github.com/users/cpitclaudel/orgs","repos_url":"https://api.github.com/users/cpitclaudel/repos","events_url":"https://api.github.com/users/cpitclaudel/events{/privacy}","received_events_url":"https://api.github.com/users/cpitclaudel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-10-25T05:24:40Z","updated_at":"2016-10-25T13:34:59Z","closed_at":null,"body":"Hi there,\r\n\r\nThis looks like a really cool project.  I tried to get a feel of how it works by interpolating a semi-bold version of Ubuntu Mono.  I used FontForge to convert the TTFs to UFO:\r\n\r\n```python\r\nfont = fontforge.open(\"UbuntuMono-R.ttf\")\r\nfont.generate(\"UbuntuMono-R.ufo\")\r\nfont.close()\r\n```\r\n\r\nThen I made the following designspace file:\r\n\r\n```xml\r\n<?xml version=\"1.0\" ?>\r\n<designspace format=\"3\">\r\n    <sources>\r\n        <source filename=\"sources/ufos/UbuntuMono-R.ufo\" name=\"ubuntu_mono_regular\">\r\n            <lib copy=\"1\"/>\r\n            <groups copy=\"1\"/>\r\n            <info copy=\"1\"/>\r\n            <location>\r\n                <dimension name=\"weight\" xvalue=\"400\"/>\r\n            </location>\r\n        </source>\r\n        <source filename=\"sources/ufos/UbuntuMono-B.ufo\" name=\"ubuntu_mono_bold\">\r\n            <location>\r\n                <dimension name=\"weight\" xvalue=\"700\"/>\r\n            </location>\r\n        </source>\r\n    </sources>\r\n    <instances>\r\n        <instance familyname=\"Ubuntu Mono\" filename=\"outputs/UbuntuMono-M.ufo\" stylename=\"Medium\">\r\n            <location>\r\n                <dimension name=\"weight\" xvalue=\"500\"/>\r\n            </location>\r\n            <info/>\r\n            <kerning/>\r\n        </instance>\r\n        <instance familyname=\"Ubuntu Mono\" filename=\"outputs/UbuntuMono-SB.ufo\" stylename=\"SemiBold\">\r\n            <location>\r\n                <dimension name=\"weight\" xvalue=\"600\"/>\r\n            </location>\r\n            <info/>\r\n            <kerning/>\r\n        </instance>\r\n    </instances>\r\n</designspace>\r\n```\r\n\r\nFinally, I ran MutatorMath like this:\r\n\r\n```python\r\nfrom mutatorMath.ufo import build\r\nbuild(\"ubuntu-mono.designspace\")\r\n```\r\n\r\nUnfortunately, this failed to generate a valid font; the log says:\r\n\r\n```\r\n2016-10-25 01:05:26,775 MutatorMath Executing designspace document: ubuntu-mono.designspace\r\n2016-10-25 01:05:26,800 MutatorMath Writing UbuntuMono-M.ufo to outputs/UbuntuMono-M.ufo\r\n2016-10-25 01:05:27,849 MutatorMath \tMultiple unicode values for glyph nonmarkingreturn: 9, 13\r\n2016-10-25 01:05:27,850 MutatorMath \tMultiple unicode values for glyph .null: 8, 0, 29\r\n2016-10-25 01:05:29,731 MutatorMath outputs/UbuntuMono-M.ufo:\r\nErrors calculating 427 glyphs: \r\n[…]\r\n```\r\n\r\nI removed the catch-all exception handler around _calculateGlyph in `ufo/instance.py` and got the following backtrace:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"./buildinstances.py\", line 19, in <module>\r\n    main()\r\n  File \"./buildinstances.py\", line 16, in main\r\n    build(\"ubuntu-mono.designspace\")\r\n  File \"./deps/MutatorMath/Lib/mutatorMath/ufo/__init__.py\", line 56, in build\r\n    reader.process()\r\n  File \"./deps/MutatorMath/Lib/mutatorMath/ufo/document.py\", line 418, in process\r\n    self.readInstances(makeGlyphs=makeGlyphs, makeKerning=makeKerning, makeInfo=makeInfo)\r\n  File \"./deps/MutatorMath/Lib/mutatorMath/ufo/document.py\", line 572, in readInstances\r\n    self._readSingleInstanceElement(instanceElement, makeGlyphs=makeGlyphs, makeKerning=makeKerning, makeInfo=makeInfo)\r\n  File \"./deps/MutatorMath/Lib/mutatorMath/ufo/document.py\", line 631, in _readSingleInstanceElement\r\n    instanceObject.addGlyph(n, unicodeValue)\r\n  File \"./deps/MutatorMath/Lib/mutatorMath/ufo/instance.py\", line 345, in addGlyph\r\n    self._calculateGlyph(glyphObject, instanceLocation, glyphMasters)\r\n  File \"./deps/MutatorMath/Lib/mutatorMath/ufo/instance.py\", line 371, in _calculateGlyph\r\n    bias, m = buildMutator(items, warpDict=self.warpDict)\r\n  File \"./deps/MutatorMath/Lib/mutatorMath/objects/mutator.py\", line 46, in buildMutator\r\n    onx.append((lb, obj-m.getNeutral()))\r\n  File \"./deps/fontMath/Lib/fontMath/mathGlyph.py\", line 167, in __sub__\r\n    self._processMathOne(copiedGlyph, otherGlyph, subPt, sub)\r\n  File \"./deps/fontMath/Lib/fontMath/mathGlyph.py\", line 178, in _processMathOne\r\n    copiedGlyph.contours = _processMathOneContours(self.contours, otherGlyph.contours, ptFunc)\r\n  File \"./deps/fontMath/Lib/fontMath/mathGlyph.py\", line 516, in _processMathOneContours\r\n    pt2 = points2[index][1]\r\nIndexError: list index out of range\r\n```\r\n\r\nHere's the context in which this error occurred, courtesy of PDB:\r\n\r\n```python\r\n(Pdb) pprint(locals())\r\n{'contour1': {'identifier': None,\r\n              'points': [('qcurve', (249, 499), False, None, None),\r\n                         (None, (239, 464), False, None, None),\r\n                         (None, (222, 401), False, None, None),\r\n                         (None, (207, 340), False, None, None),\r\n                         (None, (194, 278), False, None, None),\r\n                         ('qcurve', (188, 245), False, None, None),\r\n                         (None, (188, 245), False, None, None),\r\n                         (None, (309, 245), False, None, None),\r\n                         ('curve', (309, 245), False, None, None),\r\n                         (None, (303, 278), False, None, None),\r\n                         (None, (291, 340), False, None, None),\r\n                         (None, (276, 401), False, None, None),\r\n                         (None, (259, 464), False, None, None)]},\r\n 'contourIdentifier': None,\r\n 'contours1': [{'identifier': None,\r\n                'points': [('curve', (359, 0), False, None, None),\r\n                           (None, (359, 0), False, None, None),\r\n                           (None, (330, 143), False, None, None),\r\n                           ('curve', (330, 143), False, None, None),\r\n                           (None, (330, 143), False, None, None),\r\n                           (None, (165, 143), False, None, None),\r\n                           ('curve', (165, 143), False, None, None),\r\n                           (None, (165, 143), False, None, None),\r\n                           (None, (137, 0), False, None, None),\r\n                           ('curve', (137, 0), False, None, None),\r\n                           (None, (137, 0), False, None, None),\r\n                           (None, (9, 0), False, None, None),\r\n                           ('curve', (9, 0), False, None, None),\r\n                           (None, (53, 183), False, None, None),\r\n                           (None, (143, 484), False, None, None),\r\n                           ('qcurve', (185, 619), False, None, None),\r\n                           (None, (185, 619), False, None, None),\r\n                           (None, (319, 619), False, None, None),\r\n                           ('curve', (319, 619), False, None, None),\r\n                           (None, (363, 483), False, None, None),\r\n                           (None, (450, 178), False, None, None),\r\n                           ('qcurve', (491, 0), False, None, None),\r\n                           (None, (491, 0), False, None, None),\r\n                           (None, (359, 0), False, None, None)]},\r\n               {'identifier': None,\r\n                'points': [('qcurve', (249, 499), False, None, None),\r\n                           (None, (239, 464), False, None, None),\r\n                           (None, (222, 401), False, None, None),\r\n                           (None, (207, 340), False, None, None),\r\n                           (None, (194, 278), False, None, None),\r\n                           ('qcurve', (188, 245), False, None, None),\r\n                           (None, (188, 245), False, None, None),\r\n                           (None, (309, 245), False, None, None),\r\n                           ('curve', (309, 245), False, None, None),\r\n                           (None, (303, 278), False, None, None),\r\n                           (None, (291, 340), False, None, None),\r\n                           (None, (276, 401), False, None, None),\r\n                           (None, (259, 464), False, None, None)]}],\r\n 'contours2': [{'identifier': None,\r\n                'points': [('curve', (404, 0), False, None, None),\r\n                           (None, (404, 0), False, None, None),\r\n                           (None, (367, 162), False, None, None),\r\n                           ('curve', (367, 162), False, None, None),\r\n                           (None, (367, 162), False, None, None),\r\n                           (None, (129, 162), False, None, None),\r\n                           ('curve', (129, 162), False, None, None),\r\n                           (None, (129, 162), False, None, None),\r\n                           (None, (93, 0), False, None, None),\r\n                           ('curve', (93, 0), False, None, None),\r\n                           (None, (93, 0), False, None, None),\r\n                           (None, (9, 0), False, None, None),\r\n                           ('curve', (9, 0), False, None, None),\r\n                           (None, (26, 66), False, None, None),\r\n                           (None, (68, 220), False, None, None),\r\n                           (None, (117, 382), False, None, None),\r\n                           (None, (171, 545), False, None, None),\r\n                           ('qcurve', (201, 619), False, None, None),\r\n                           (None, (201, 619), False, None, None),\r\n                           (None, (303, 619), False, None, None),\r\n                           ('curve', (303, 619), False, None, None),\r\n                           (None, (332, 545), False, None, None),\r\n                           (None, (385, 382), False, None, None),\r\n                           (None, (432, 220), False, None, None),\r\n                           (None, (474, 66), False, None, None),\r\n                           ('qcurve', (491, 0), False, None, None),\r\n                           (None, (491, 0), False, None, None),\r\n                           (None, (404, 0), False, None, None)]},\r\n               {'identifier': None,\r\n                'points': [('qcurve', (249, 547), False, None, None),\r\n                           (None, (226, 484), False, None, None),\r\n                           (None, (172, 318), False, None, None),\r\n                           ('qcurve', (148, 230), False, None, None),\r\n                           (None, (148, 230), False, None, None),\r\n                           (None, (348, 230), False, None, None),\r\n                           ('curve', (348, 230), False, None, None),\r\n                           (None, (325, 320), False, None, None),\r\n                           (None, (272, 487), False, None, None)]}],\r\n 'func': <function subPt at 0x7f7f3bbefc80>,\r\n 'identifier': None,\r\n 'index': 9,\r\n 'name': None,\r\n 'point': (None, (303, 278), False, None, None),\r\n 'points1': [('qcurve', (249, 499), False, None, None),\r\n             (None, (239, 464), False, None, None),\r\n             (None, (222, 401), False, None, None),\r\n             (None, (207, 340), False, None, None),\r\n             (None, (194, 278), False, None, None),\r\n             ('qcurve', (188, 245), False, None, None),\r\n             (None, (188, 245), False, None, None),\r\n             (None, (309, 245), False, None, None),\r\n             ('curve', (309, 245), False, None, None),\r\n             (None, (303, 278), False, None, None),\r\n             (None, (291, 340), False, None, None),\r\n             (None, (276, 401), False, None, None),\r\n             (None, (259, 464), False, None, None)],\r\n 'points2': [('qcurve', (249, 547), False, None, None),\r\n             (None, (226, 484), False, None, None),\r\n             (None, (172, 318), False, None, None),\r\n             ('qcurve', (148, 230), False, None, None),\r\n             (None, (148, 230), False, None, None),\r\n             (None, (348, 230), False, None, None),\r\n             ('curve', (348, 230), False, None, None),\r\n             (None, (325, 320), False, None, None),\r\n             (None, (272, 487), False, None, None)],\r\n 'pprint': <function pprint at 0x7f7f3a2fc378>,\r\n 'pt': (37, -242),\r\n 'pt1': (303, 278),\r\n 'pt2': (272, 487),\r\n 'result': [{'identifier': None,\r\n             'points': [('curve', (-45, 0), False, None, None),\r\n                        (None, (-45, 0), False, None, None),\r\n                        (None, (-37, -19), False, None, None),\r\n                        ('curve', (-37, -19), False, None, None),\r\n                        (None, (-37, -19), False, None, None),\r\n                        (None, (36, -19), False, None, None),\r\n                        ('curve', (36, -19), False, None, None),\r\n                        (None, (36, -19), False, None, None),\r\n                        (None, (44, 0), False, None, None),\r\n                        ('curve', (44, 0), False, None, None),\r\n                        (None, (44, 0), False, None, None),\r\n                        (None, (0, 0), False, None, None),\r\n                        ('curve', (0, 0), False, None, None),\r\n                        (None, (27, 117), False, None, None),\r\n                        (None, (75, 264), False, None, None),\r\n                        ('qcurve', (68, 237), False, None, None),\r\n                        (None, (14, 74), False, None, None),\r\n                        (None, (118, 0), False, None, None),\r\n                        ('curve', (118, 0), False, None, None),\r\n                        (None, (60, -136), False, None, None),\r\n                        (None, (147, -441), False, None, None),\r\n                        ('qcurve', (159, -545), False, None, None),\r\n                        (None, (106, -382), False, None, None),\r\n                        (None, (-73, -220), False, None, None)]}],\r\n 'resultPoints': [('qcurve', (0, -48), False, None, None),\r\n                  (None, (13, -20), False, None, None),\r\n                  (None, (50, 83), False, None, None),\r\n                  (None, (59, 110), False, None, None),\r\n                  (None, (46, 48), False, None, None),\r\n                  ('qcurve', (-160, 15), False, None, None),\r\n                  (None, (-160, 15), False, None, None),\r\n                  (None, (-16, -75), False, None, None),\r\n                  ('curve', (37, -242), False, None, None)],\r\n 'segmentType': None,\r\n 'smooth': False}\r\n```\r\n\r\nAm I doing something wrong?  Thanks for this cool project!"},"comment":{"url":"https://api.github.com/repos/LettError/MutatorMath/issues/comments/256035972","html_url":"https://github.com/LettError/MutatorMath/issues/58#issuecomment-256035972","issue_url":"https://api.github.com/repos/LettError/MutatorMath/issues/58","id":256035972,"user":{"login":"cpitclaudel","id":8181630,"avatar_url":"https://avatars.githubusercontent.com/u/8181630?v=3","gravatar_id":"","url":"https://api.github.com/users/cpitclaudel","html_url":"https://github.com/cpitclaudel","followers_url":"https://api.github.com/users/cpitclaudel/followers","following_url":"https://api.github.com/users/cpitclaudel/following{/other_user}","gists_url":"https://api.github.com/users/cpitclaudel/gists{/gist_id}","starred_url":"https://api.github.com/users/cpitclaudel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpitclaudel/subscriptions","organizations_url":"https://api.github.com/users/cpitclaudel/orgs","repos_url":"https://api.github.com/users/cpitclaudel/repos","events_url":"https://api.github.com/users/cpitclaudel/events{/privacy}","received_events_url":"https://api.github.com/users/cpitclaudel/received_events","type":"User","site_admin":false},"created_at":"2016-10-25T13:34:59Z","updated_at":"2016-10-25T13:34:59Z","body":"Thanks for explaining! I understand.  I don't think this is something I could figure out myself in a small amount of time, but hopefully someone will :)"}}
{"actor":{"display_login":"cpitclaudel"}}