Expand description
A Pure Rust library for compressing TTF fonts to WOFF2 format.
§Example
use ttf2woff2::{encode, BrotliQuality};
let ttf_data = std::fs::read("font.ttf").unwrap();
let woff2_data = encode(&ttf_data, BrotliQuality::default()).unwrap();
std::fs::write("font.woff2", &woff2_data).unwrap();Structs§
- Brotli
Quality - Brotli compression quality.
- Encode
Options - Options for WOFF2 encoding.
Enums§
- Error
- Error type for the library
Functions§
- encode
- Encode a TTF font as WOFF2 with the
glyf/locatransformation enabled. - encode_
no_ transform - Encode a TTF font as WOFF2 without applying the
glyf/locatransformation. - encode_
with_ options - Encode a TTF font as WOFF2 with full control over
EncodeOptions.