{"action":"created","issue":{"url":"https://api.github.com/repos/nodebox/opentype.js/issues/94","labels_url":"https://api.github.com/repos/nodebox/opentype.js/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/nodebox/opentype.js/issues/94/comments","events_url":"https://api.github.com/repos/nodebox/opentype.js/issues/94/events","html_url":"https://github.com/nodebox/opentype.js/issues/94","id":57383702,"number":94,"title":"Font.glyphs *must* be sorted by Unicode, or font creation fails","user":{"login":"mattlag","id":5897669,"avatar_url":"https://avatars.githubusercontent.com/u/5897669?v=3","gravatar_id":"","url":"https://api.github.com/users/mattlag","html_url":"https://github.com/mattlag","followers_url":"https://api.github.com/users/mattlag/followers","following_url":"https://api.github.com/users/mattlag/following{/other_user}","gists_url":"https://api.github.com/users/mattlag/gists{/gist_id}","starred_url":"https://api.github.com/users/mattlag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattlag/subscriptions","organizations_url":"https://api.github.com/users/mattlag/orgs","repos_url":"https://api.github.com/users/mattlag/repos","events_url":"https://api.github.com/users/mattlag/events{/privacy}","received_events_url":"https://api.github.com/users/mattlag/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-02-11T21:57:15Z","updated_at":"2015-02-12T07:11:31Z","closed_at":null,"body":"For Glyphr Studio, I'm generating an opentype.Font object manually.  I was getting lots of 'not a valid font file' errors as a result of Font.download() - and I discovered it was just because the Font.glyphs array was not sorted.  Specifically:\r\n\r\n- The .notdef glyph must exist and must be first\r\n- The rest of the glyphs must be sorted by Unicode number\r\n\r\nIdeally, opentype.js would do this sorting.  And, even better, add a default .notdef glyph if there isn't one.\r\n\r\nAt the very least, this should be added to the Readme example.\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/nodebox/opentype.js/issues/comments/74027337","html_url":"https://github.com/nodebox/opentype.js/issues/94#issuecomment-74027337","issue_url":"https://api.github.com/repos/nodebox/opentype.js/issues/94","id":74027337,"user":{"login":"moyogo","id":1923747,"avatar_url":"https://avatars.githubusercontent.com/u/1923747?v=3","gravatar_id":"","url":"https://api.github.com/users/moyogo","html_url":"https://github.com/moyogo","followers_url":"https://api.github.com/users/moyogo/followers","following_url":"https://api.github.com/users/moyogo/following{/other_user}","gists_url":"https://api.github.com/users/moyogo/gists{/gist_id}","starred_url":"https://api.github.com/users/moyogo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moyogo/subscriptions","organizations_url":"https://api.github.com/users/moyogo/orgs","repos_url":"https://api.github.com/users/moyogo/repos","events_url":"https://api.github.com/users/moyogo/events{/privacy}","received_events_url":"https://api.github.com/users/moyogo/received_events","type":"User","site_admin":false},"created_at":"2015-02-12T07:11:31Z","updated_at":"2015-02-12T07:11:31Z","body":"“Font.glyphs *must* be sorted by Unicode”: that shouldn’t be a requirement. A lot of space can be saved when glyph order and glyph classes in GPOS/GSUB are optimized by range.\r\n\r\nHaving “two glyphs share a unicode value” is wrong, the cmap doesn’t allow that."}}