{"action":"created","issue":{"url":"https://api.github.com/repos/behdad/fonttools/issues/471","labels_url":"https://api.github.com/repos/behdad/fonttools/issues/471/labels{/name}","comments_url":"https://api.github.com/repos/behdad/fonttools/issues/471/comments","events_url":"https://api.github.com/repos/behdad/fonttools/issues/471/events","html_url":"https://github.com/behdad/fonttools/issues/471","id":127472552,"number":471,"title":"[feaLib] Stripping away ValueRecords with ValueFormat zero","user":{"login":"brawer","id":1527880,"avatar_url":"https://avatars.githubusercontent.com/u/1527880?v=3","gravatar_id":"","url":"https://api.github.com/users/brawer","html_url":"https://github.com/brawer","followers_url":"https://api.github.com/users/brawer/followers","following_url":"https://api.github.com/users/brawer/following{/other_user}","gists_url":"https://api.github.com/users/brawer/gists{/gist_id}","starred_url":"https://api.github.com/users/brawer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brawer/subscriptions","organizations_url":"https://api.github.com/users/brawer/orgs","repos_url":"https://api.github.com/users/brawer/repos","events_url":"https://api.github.com/users/brawer/events{/privacy}","received_events_url":"https://api.github.com/users/brawer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-19T15:36:31Z","updated_at":"2016-01-19T15:42:48Z","closed_at":null,"body":"When building SinglePos tables moved to otlLib, feaLib started stripping off SinglePos entries whose ValueRecord.ValueFormat is zero. However, `makeotf` emits such entries in its output, so we now have a discrepancy to makeotf. Question: Are we doing a valid optimization here, or are they semantically different? What if SinglePos lookup gets chained from another ChainContextPos lookup?\r\n\r\nSample input:\r\n```\r\nfeature test {\r\n    pos zero 0;\r\n    pos four 500;\r\n} test;\r\n```\r\n\r\nmakeotf output:\r\n```\r\n      <!-- LookupCount=1 -->\r\n      <Lookup index=\"0\">\r\n        <!-- LookupType=1 -->\r\n        <LookupFlag value=\"0\"/>\r\n        <!-- SubTableCount=2 -->\r\n        <SinglePos index=\"0\" Format=\"1\">\r\n          <Coverage>\r\n            <Glyph value=\"zero\"/>\r\n          </Coverage>\r\n          <ValueFormat value=\"0\"/>\r\n        </SinglePos>\r\n        <SinglePos index=\"1\" Format=\"1\">\r\n          <Coverage>\r\n            <Glyph value=\"four\"/>\r\n          </Coverage>\r\n          <ValueFormat value=\"4\"/>\r\n          <Value XAdvance=\"500\"/>\r\n        </SinglePos>\r\n      </Lookup>\r\n```\r\n\r\nfeaLib output:\r\n```\r\n      <!-- LookupCount=1 -->\r\n      <Lookup index=\"0\">\r\n        <!-- LookupType=1 -->\r\n        <LookupFlag value=\"0\"/>\r\n        <!-- SubTableCount=1 -->\r\n        <SinglePos index=\"0\" Format=\"1\">\r\n          <Coverage>\r\n            <Glyph value=\"four\"/>\r\n          </Coverage>\r\n          <ValueFormat value=\"4\"/>\r\n          <Value XAdvance=\"500\"/>\r\n        </SinglePos>\r\n      </Lookup>\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/behdad/fonttools/issues/comments/172892294","html_url":"https://github.com/behdad/fonttools/issues/471#issuecomment-172892294","issue_url":"https://api.github.com/repos/behdad/fonttools/issues/471","id":172892294,"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-19T15:42:48Z","updated_at":"2016-01-19T15:42:48Z","body":"This is an unsafe optimization *when and only when* other subtables might be appended after this one.  In other words, the semantic difference is that, when the entry is available (albeit all zero), it will stop searching forward in the subtables that follow.\r\n\r\nIt does not have any effect in chaining/context."}}