Skip to content
/ ttf2woff2 Public

A Rust library and CLI for for compressing a TTF font to WOFF2 format.

License

MIT, OFL-1.1 licenses found

Licenses found

MIT
LICENSE
OFL-1.1
OFL.txt
Notifications You must be signed in to change notification settings

0x6b/ttf2woff2

Repository files navigation

ttf2woff2

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.

Prerequisites

  • Linux (tested on Ubuntu 22.04.4 LTS): sudo apt install -y libbrotli-dev, g++
  • macOS (tested on Sonoma 14.4): brew install brotli

Build

$ cargo build --release

Usage

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

License

Acknowledgements

Reference

About

A Rust library and CLI for for compressing a TTF font to WOFF2 format.

Topics

Resources

License

MIT, OFL-1.1 licenses found

Licenses found

MIT
LICENSE
OFL-1.1
OFL.txt

Stars

Watchers

Forks

Languages