Open seflless opened 4 months ago
I did a quick test today using the subset-font package and it worked out of the gate. But it uses harfbuzzjs, which has a >500K .wasm file. This is a large dependency. Here's the test repo
I'm assuming ideally you'd want something built in that can run client side, perhaps it should be first built as an extra dependency people can opt-into for Tldraw?
The reduction in size was pretty dramatic.
The font went from 153KB to 4KB. My exported SVG file went from 209KB to 10KB.
I did a quick test today using the subset-font package and it worked out of the gate. But it uses harfbuzzjs, which has a >500K .wasm file. This is a large dependency. Here's the test repo
That's super neat. But yeah, that dependency size is prohibitively large :-/ I think you're right that it's something that should be opt-ed into. We're formulating slowly a plan on how to be able to opt into things in a generalized way so this type of behavior could also be something that fits in with that strategy.
What's the feature?
Tldraw currently embeds the entire font for each referenced in exported file. The files can become quite large because of this.
Eg. this simple Tldraw test file that uses all 4 built in fonts, generates a >400K svg file
Notes
Contact Details
francoislaberge@gmail.com
Code of Conduct