Hacker News new | ask | show | jobs
by hsfzxjy 663 days ago
You can't test it in a browser, since no browser at present is linked against libharfbuzz with WASM shaper. Instead, one can test it with a modified local program such as gedit in the demo.

As convenience, I built a Docker image that packs both the ttf file and the modified gedit together. You can try it out via `make run` as stated in the instructions.

2 comments

If you just want to run locally. Why not using the native libharfbuzz directly? What's the purpose of WASM here?
Font includes WASM code that harfbuzz executes for shaping: https://github.com/harfbuzz/harfbuzz/blob/main/docs/wasm-sha...

It's an experimental feature, so it's not available unless explicitly enabled during compilation.

WASM is to libharfbuzz (when experimental compile time option is enabled) what javascript is to HTML.

So this is essentially native (albeit experimental) libharfbuzz. WASM is used because its how font files are scripted (when using this experimental version of lubharfbuzz)

Its important to keep in mind that wasm is a general technology and is not just used by web browsers.

Harfbuzz can be built easily to Wasm using Emscripten.
Interesting artifact of time it would be. Harfbuzz uses https://github.com/bytecodealliance/wasm-micro-runtime to execute wasm, so when compiled it would be wasm runtime running under another wasm runtime.