touchifyapp / wasm-ttf2woff

A WebAssembly module that converts TTF/OTF fonts to WOFF who can run in Browser or in Node.JS
MIT License
9 stars 1 forks source link

Support woff2 and release woff/woff2 crate #1

Open yisibl opened 2 years ago

yisibl commented 2 years ago

The compression rate of woff2 is better. This is the W3C recommendation standard and is currently the best web font compression format.

Thank you for writing this great library. Your library is the first one I have seen that uses pure rust to manually encode the woff format. There are many crates just through FFI bindings to woff2 library. For example: https://crates.io/crates/woff2-sys

Can you release a separate crate for the encoder of woff or woff2?

I have plans to use Rust to bring ttf2woff functionality to Node.js through napi-rs. In this way, the performance of the Node.js library will be greatly improved.

(napi-rs is a minimal library for building compiled Node.js add-ons in Rust)

cjhgit commented 2 years ago

@yisibl 你好,请问如果我想只在浏览器端实现生成 woff2 的功能,我可以用什么方式去实现?

yisibl commented 1 year ago

@cjhgit The compression algorithm for woff2 uses brotli, so in a browser you may first need https://github.com/httptoolkit/brotli-wasm