Node.js font converter capable of converting SFNT ([TrueType](https://en.wikipedia.org/wiki/TrueType), [OpenType](https://en.wikipedia.org/wiki/OpenType)) font files to [WOFF](https://en.wikipedia.org/wiki/Web_Open_Font_Format) and vice-versa.
npm install woff-toolswoff-tools | OTF to WOFF / WOFF to OTF / TTF to WOFF / WOFF to TTFNode.js font converter capable of converting SFNT (TrueType, OpenType) font files to WOFF and vice-versa.
Forked from https://github.com/odemiral/woff2sfnt-sfnt2woff and added some clearer documentation, a package.json and added to npm.
> woff2sfnt-sfnt2woff is based on an Ubuntu package woff-tools, which contains the two commands woff2sfnt and sfnt2woff. As far as I can find, this Ubuntu package is the original package released with woff by Mozilla.
``sh`Convert from ttf to woff
node sfnt2woff.js input.ttf output.woffConvert from otf to woff
node sfnt2woff.js input.otf output.woff
`sh`Convert from woff to ttf
node woff2sfnt.js input.woff output.ttfConvert from woff to otf
node woff2sfnt.js input.woff output.otf
`js
// ttf to woff
const { toWoff } = require("woff-tools");
const fs = require("fs");
fs.writeFileSync("output.woff", toWoff(fs.readFileSync("input.ttf")));
`
`js
// woff to ttf
const { toSfnt } = require("woff-tools");
const fs = require("fs");
fs.writeFileSync("output.ttf", toSfnt(fs.readFileSync("input.woff")));
``
MIT License