{"action":"created","issue":{"url":"https://api.github.com/repos/behdad/fonttools/issues/463","labels_url":"https://api.github.com/repos/behdad/fonttools/issues/463/labels{/name}","comments_url":"https://api.github.com/repos/behdad/fonttools/issues/463/comments","events_url":"https://api.github.com/repos/behdad/fonttools/issues/463/events","html_url":"https://github.com/behdad/fonttools/issues/463","id":126306589,"number":463,"title":"Error exporting OTF","user":{"login":"aaronbell","id":8460297,"avatar_url":"https://avatars.githubusercontent.com/u/8460297?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronbell","html_url":"https://github.com/aaronbell","followers_url":"https://api.github.com/users/aaronbell/followers","following_url":"https://api.github.com/users/aaronbell/following{/other_user}","gists_url":"https://api.github.com/users/aaronbell/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronbell/subscriptions","organizations_url":"https://api.github.com/users/aaronbell/orgs","repos_url":"https://api.github.com/users/aaronbell/repos","events_url":"https://api.github.com/users/aaronbell/events{/privacy}","received_events_url":"https://api.github.com/users/aaronbell/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-01-12T23:54:51Z","updated_at":"2016-01-23T23:06:10Z","closed_at":null,"body":"I'm using the [FontMake](https://github.com/googlei18n/fontmake) package to convert https://github.com/Microsoft/Selawik to binary files. However, I run into an error:\r\n\r\n`  File \"/Library/Python/2.7/site-packages/fonttools-3.0-py2.7.egg/fontTools/ttLib/tables/otBase.py\", line 457, in writeUShort\r\n    assert 0 <= value < 0x10000, value`\r\n\r\nWhen I strip out all the OpenType code, the process works correctly. Any idea what is causing this? "},"comment":{"url":"https://api.github.com/repos/behdad/fonttools/issues/comments/174229374","html_url":"https://github.com/behdad/fonttools/issues/463#issuecomment-174229374","issue_url":"https://api.github.com/repos/behdad/fonttools/issues/463","id":174229374,"user":{"login":"behdad","id":142891,"avatar_url":"https://avatars.githubusercontent.com/u/142891?v=3","gravatar_id":"","url":"https://api.github.com/users/behdad","html_url":"https://github.com/behdad","followers_url":"https://api.github.com/users/behdad/followers","following_url":"https://api.github.com/users/behdad/following{/other_user}","gists_url":"https://api.github.com/users/behdad/gists{/gist_id}","starred_url":"https://api.github.com/users/behdad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/behdad/subscriptions","organizations_url":"https://api.github.com/users/behdad/orgs","repos_url":"https://api.github.com/users/behdad/repos","events_url":"https://api.github.com/users/behdad/events{/privacy}","received_events_url":"https://api.github.com/users/behdad/received_events","type":"User","site_admin":false},"created_at":"2016-01-23T23:06:10Z","updated_at":"2016-01-23T23:06:10Z","body":"Here's a patch that I think is correct, but @brawer should confirm what he intended there.  In particular, there's a test that will fail with the patch, which concerns me, because I was under the impression that @brawer added expected-TTX for the tests comparing to what makeotf does, so he needs to investigate this one.\r\n```\r\ndiff --git a/Lib/fontTools/feaLib/builder.py b/Lib/fontTools/feaLib/builder.py\r\nindex be6c7f4..75907a5 100644\r\n--- a/Lib/fontTools/feaLib/builder.py\r\n+++ b/Lib/fontTools/feaLib/builder.py\r\n@@ -791,7 +791,7 @@ class ChainContextPosBuilder(LookupBuilder):\r\n             st.PosCount = len([l for l in lookups if l is not None])\r\n             st.PosLookupRecord = []\r\n             for sequenceIndex, l in enumerate(lookups):\r\n-                if l is not None:\r\n+                if l.lookup_index is not None:\r\n                     rec = otTables.PosLookupRecord()\r\n                     rec.SequenceIndex = sequenceIndex\r\n                     rec.LookupListIndex = l.lookup_index\r\n@@ -821,7 +821,7 @@ class ChainContextSubstBuilder(LookupBuilder):\r\n             st.SubstCount = len([l for l in lookups if l is not None])\r\n             st.SubstLookupRecord = []\r\n             for sequenceIndex, l in enumerate(lookups):\r\n-                if l is not None:\r\n+                if l.lookup_index is not None:\r\n                     rec = otTables.SubstLookupRecord()\r\n                     rec.SequenceIndex = sequenceIndex\r\n                     rec.LookupListIndex = l.lookup_index\r\n```"}}