1. ttf2woff2
Convert TTF files to WOFF2 ones.
ttf2woff2
Package: ttf2woff2
Created by: nfroidure
Last modified: Mon, 05 Dec 2022 18:53:46 GMT
Version: 5.0.0
License: MIT
Downloads: 878,642
Repository: https://github.com/nfroidure/ttf2woff2

Install

npm install ttf2woff2
yarn add ttf2woff2

ttf2woff2

Convert TTF files to WOFF2 ones.

GitHub license
Coverage Status
NPM version
Dependency 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

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code