crowbar icon indicating copy to clipboard operation
crowbar copied to clipboard

Support Harfbuzz Wasm Shaper

Open bbb651 opened this issue 1 year ago • 1 comments

I recently watched this talk Programmable fonts with Rust by Valdemar Erk which showcases cool uses for a relatively new feature in Harfbuzz called Wasm Shaper, which let's font use embedded wasm to programmatically control shaping.

I haven't found a quick way to play around with it, as it seems like it's turned off in all software I use, I think it's off by default and the -Dwasm=enabled option enables it. I think it might be a bit tricky to get it to work, in order for Harfbuzz to run wasm when compiled to wasm it either needs to have a wasm runtime in wasm (this is something most runtimes support, but wasm-micro-runtime specifically doesn't seem to support it) or to somehow call out to js in order to run it with web apis.

Harfbuzz has a page with more details and some demos.

bbb651 avatar Jun 21 '24 06:06 bbb651

I wrote the demos. :-)

I haven't been able to compile a WASM version of the WASM runtime, and so I haven't worked out how best to implement this.

simoncozens avatar Jun 21 '24 08:06 simoncozens

I don't think this is possible, sadly. We would need a WASM-compiled harfbuzz containing its own internal WASM machine.

simoncozens avatar Oct 08 '25 15:10 simoncozens