Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ttf2woff2-no-gyp

nfroidure6.4kMIT4.0.6

Convert TTF files to WOFF2 ones.

ttf, woff2, fonts

readme

ttf2woff2

Convert TTF files to WOFF2 ones.

GitHub license Coverage Status NPM version Dependency Status devDependency Status Package Quality

This is a NodeJS wrapper for the Google WOFF2 project. If the C++ wrapper compilation fail, it fallbacks to an Emscripten build.

Usage

CLI

Install ttf2woff2 globally, then:

cat font.ttf | ttf2woff2 > font.woff2

On Windows without cat, use (in PowerShell):

Start-Process -NoNewWindow -Wait ttf2woff2.cmd -RedirectStandardInput font.ttf -RedirectStandardOutput font.woff2
# OR
start-process -nnw -wait ttf2woff2.cmd -rsi font.ttf -rso font.woff2

API

var fs = require('fs');
var ttf2woff2 = require('ttf2woff2');

var input = fs.readFileSync('font.ttf');

fs.writeFileSync('font.woff2', ttf2woff2(input));

Contributing

Feel free to push your code if you agree with publishing under the MIT license.

Authors

License

MIT

changelog

4.0.4 (2021-05-29)

Chore

  • dependencies: Update jest, mocha, node-gyp (#71)

4.0.3 (2021-05-29)

Bug Fixes

4.0.2 (2021-03-15)

Bug Fixes

4.0.1 (2020-12-22)

Bug Fixes

  • bundle: add necessary files to the bundle (fc9bb76)

4.0.0 (2020-12-22)

chore

  • dependencies: update dependencies (0657e8d)

BREAKING CHANGES

  • dependencies: Requiring Node12 to work