font editor core functions
- sfnt parse
- read, write, transform fonts (ttf, woff, eot, svg, otf)
- ttf glyph adjust
- svg to glyph
// read font file
var fs = require('fs');
var bufferToArrayBuffer = require('b3b').bufferToArrayBuffer;
var fontBuffer = fs.readFileSync('font.ttf');
var fontArrayBuffer = bufferToArrayBuffer(fontBuffer);
// read font data
var TTFReader = require('fonteditor-core').TTFReader;
var ttfReader = new TTFReader({ hinting: true });
var fontData = ttfReader.read(fontArrayBuffer);
console.log(Object.keys(fontData));
/* => [ 'version',
'numTables',
'searchRenge',
'entrySelector',
'rengeShift',
'head',
'maxp',
'glyf',
'cmap',
'name',
'hhea',
'post',
'OS/2',
'fpgm',
'cvt',
'prep'
]
*/
edp webserver
open http://127.0.0.1:9999/demo
MIT © Fonteditor