vercel / satori

Enlightened library to convert HTML and CSS to SVG
https://og-playground.vercel.app
Mozilla Public License 2.0
10.55k stars 228 forks source link

Woff2 support #3

Closed shuding closed 1 year ago

shuding commented 2 years ago

Currently opentype.js doesn't support woff2, which is usually 30% the size of woff. Fontkit might be a good alternative for this (but the lib is larger).

Ref: https://github.com/opentypejs/opentype.js/issues/183

shuding commented 2 years ago

Another advanced feature that Fontkit supports is color emoji glyphs, downside is Fontkit is Node.js only (using Buffer and fs). Options:

shuding commented 2 years ago

Decided to put a lower priority on this. TTF & OTF are faster to load and parse, so on the server side we will always recommend using them unless there's a size limitation. WOFF is a good balance of size and parsing speed (smaller but slightly longer to load).