opentypejs / opentype.js

Read and write OpenType fonts using JavaScript.
https://opentype.js.org/
MIT License
4.45k stars 475 forks source link

Add export support for kerning #112

Open fdb opened 9 years ago

fdb commented 9 years ago

Support both the kern table and GPOS.

felipesanches commented 9 years ago

Issue #152 may be the way to go!

Balearica commented 2 years ago

I implemented a bare-bones interface for writing fonts with GPOS pair kerning for my project Scribe OCR. I plan on turning this into a pull request for opentype.js when I have time, however in the meantime if anybody has a need for writing fonts with kerning, let me know and I can provide code snippets.

One additional note--while it would be easy from a technical perspective to add support for the kern table as well (as specified by the original post), I do not see value in doing so as opentype.js does not support writing TrueType outlines. According to the official spec, for CFF outlines (what opentype.js creates) kerning information should be specified using the GPOS table. While some programs ignore this detail and use the kern table for both CFF and TrueType outlines, the OpenType Sanitizer (used for both Chrome and Firefox) removes the kern table for fonts with CFF outlines.