A Rust library and CLI for compressing a TTF font to WOFF2 format. The output is compatible with google/woff2 (via the woff2_compress
command).
You may use Brooooooklyn/woff-build instead, which has a more user-friendly interface. This library is more for my personal use and learning purposes.
- Linux (tested on Ubuntu 22.04.4 LTS):
sudo apt install -y libbrotli-dev, g++
- macOS (tested on Sonoma 14.4):
brew install brotli
$ cargo build --release
Usage: ttf2woff2 [OPTIONS] <INPUT>
Arguments:
<INPUT> Path to the input TTF file
Options:
-o, --output <OUTPUT> Path to the output WOFF2 file. Defaults to the name of the input file with a .woff2 extension
-q, --quality <QUALITY> Brotli quality, between 0 and 11 inclusive [default: 11]
-h, --help Print help
- The Noto Sans Japanese font for testing in the repository is licensed under its own license. See OFL.txt for details.
- Other files are licensed under the MIT. See LICENSE for details.