{"action":"opened","issue":{"url":"https://api.github.com/repos/mapbox/node-fontnik/issues/85","labels_url":"https://api.github.com/repos/mapbox/node-fontnik/issues/85/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/node-fontnik/issues/85/comments","events_url":"https://api.github.com/repos/mapbox/node-fontnik/issues/85/events","html_url":"https://github.com/mapbox/node-fontnik/issues/85","id":64055254,"number":85,"title":"Extract kerning and shaping tables from fonts?","user":{"login":"mikemorris","id":1149913,"avatar_url":"https://avatars.githubusercontent.com/u/1149913?v=3","gravatar_id":"","url":"https://api.github.com/users/mikemorris","html_url":"https://github.com/mikemorris","followers_url":"https://api.github.com/users/mikemorris/followers","following_url":"https://api.github.com/users/mikemorris/following{/other_user}","gists_url":"https://api.github.com/users/mikemorris/gists{/gist_id}","starred_url":"https://api.github.com/users/mikemorris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikemorris/subscriptions","organizations_url":"https://api.github.com/users/mikemorris/orgs","repos_url":"https://api.github.com/users/mikemorris/repos","events_url":"https://api.github.com/users/mikemorris/events{/privacy}","received_events_url":"https://api.github.com/users/mikemorris/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-24T17:35:45Z","updated_at":"2015-03-24T17:35:45Z","closed_at":null,"body":"**tl;dr** Can we use ICU or HarfBuzz to extract shaping and kerning tables from a font?\r\n\r\nFrom discussion with @nickidlugash on adding kerning support:\r\n\r\n> FreeType only supports kerning via the (rather simple) ‘kern’ table. For the interpretation of kerning data in the (highly sophisticated) ‘GPOS’ table you need a higher-level library like ICU or HarfBuzz since it can be context dependent (this is, the kerning may vary depending on the position within a text string, for example).\r\nhttp://freetype.org/freetype2/docs/glyphs/glyphs-4.html\r\n\r\n- FreeType has [limited support](http://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_FACE_FLAG_KERNING) for reading kerning tables and running [`FT_Get_Kerning`](http://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_Get_Kerning) for all possible glyph pairs seems like a terrible idea.\r\n- We'll need to integrate HarfBuzz (and a JavaScript equivalent?) into our rendering engines at some point for [complex text shaping](https://github.com/mapbox/mapbox-gl-js/issues/471), could we handle kerning at this point too?\r\n- Is it possible to use ICU or HarfBuzz to extract shaping and kerning tables from a font at upload time to be stashed on S3 and used later for rendering, rather than having to load the actual font file into HarfBuzz/ICU?"}}