FlyUp/packages/字体精简工具/node_modules/ttf2woff2
2024-07-10 18:24:08 +08:00
..
bin 增加分享 2024-07-10 18:24:08 +08:00
build 增加分享 2024-07-10 18:24:08 +08:00
csrc 增加分享 2024-07-10 18:24:08 +08:00
jssrc 增加分享 2024-07-10 18:24:08 +08:00
src 增加分享 2024-07-10 18:24:08 +08:00
tests 增加分享 2024-07-10 18:24:08 +08:00
.eslintrc 增加分享 2024-07-10 18:24:08 +08:00
.istanbul.yml 增加分享 2024-07-10 18:24:08 +08:00
.travis.yml 增加分享 2024-07-10 18:24:08 +08:00
binding.gyp 增加分享 2024-07-10 18:24:08 +08:00
builderror.log 增加分享 2024-07-10 18:24:08 +08:00
LICENCE 增加分享 2024-07-10 18:24:08 +08:00
package.json 增加分享 2024-07-10 18:24:08 +08:00
README.md 增加分享 2024-07-10 18:24:08 +08:00

ttf2woff2

Convert TTF files to WOFF2.

NPM version Build status Dependency Status devDependency Status Coverage Status Code Climate

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

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.

Stats

NPM NPM