Live data from Hacker News

Show HN: Handwriter.ttf – Handwriting Synthesis with Harfbuzz WASM

github.com

1–10 of 60 posts

Show HN: Handwriter.ttf – Handwriting Synthesis with Harfbuzz WASM

#1
During the hype of llama.ttf months ago, I was speculating the potential of WASM shaper for even crazier purpose, one that fitter to a font shaper's duty -- to synthesize font at runtime. This project as proof-of-concept implements a synthesizer that generates and rasterizes handwriting-style font, backed by a super-lightweight RNN model (~14MiB).

Show HN: Handwriter.ttf – Handwriting Synthesis with Harfbuzz WASM
github.com

Re: Show HN: Handwriter.ttf – Handwriting Synthesis with Harfbuzz WASM

#2
this is amazing! i'm guessing you can probably get it to antialias without much more work

as the demo video shows, it's probably not something you want to have in between you and the ability to scroll a web page or close a tab. but i guess using harfbuzz now means we're buying into a turing-complete virtual machine running an arbitrary program in order to display a glyph. how seriously crippled are the harfbuzzless rendering paths? i'm assuming opting out of harfbuzz means opting out of arabic, devanagari and other indic scripts, etc.? is there a less out-of-control alternative that doesn't leave two billion people out in the cold?

Re: Show HN: Handwriter.ttf – Handwriting Synthesis with Harfbuzz WASM

#4

I wonder what makes SIMD an improvement here - in the end it all boils down to TTF bytecode and I don't think this comes with SIMD instructions, right?

wasm has SIMD extension https://github.com/WebAssembly/simd/blob/master/proposals/si... . You can use them even in browsers (e.g. Chrome >= 91)

Re: Show HN: Handwriter.ttf – Handwriting Synthesis with Harfbuzz WASM

#6
post #4

I wonder what makes SIMD an improvement here - in the end it all boils down to TTF bytecode and I don't think this comes with SIMD instructions, right?

wasm has SIMD extension https://github.com/WebAssembly/simd/blob/master/proposals/si... . You can use them even in browsers (e.g. Chrome >= 91)

OP is asking how SIMD is beneficial to this specific application. If there's a small neural network involved then evaluating that is probably a good place to use SIMD.

Re: Show HN: Handwriter.ttf – Handwriting Synthesis with Harfbuzz WASM

#7
post #2

this is amazing! i'm guessing you can probably get it to antialias without much more work as the demo video shows, it's probably not something you want to have in between you and the ability to scroll a web page or close a tab. but i guess using harfbuzz now means we're buying into a turing-complete virtual machine running an arbitrary program in order to display a glyph. how seriously crippled are the harfbuzzless r…

This is just a project for fun, like llama.ttf.

WASM shaper is still experimental and not yet shipped in and products, not before more limitation carried out as I think. So I'm not too worried about it.

Re: Show HN: Handwriter.ttf – Handwriting Synthesis with Harfbuzz WASM

#9
post #5

I don't get it, why there's no link to a GitHub pages website to test the thing?

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.

Re: Show HN: Handwriter.ttf – Handwriting Synthesis with Harfbuzz WASM

#10
post #6
post #4

Earlier quoted context omitted.

wasm has SIMD extension https://github.com/WebAssembly/simd/blob/master/proposals/si... . You can use them even in browsers (e.g. Chrome >= 91)

OP is asking how SIMD is beneficial to this specific application. If there's a small neural network involved then evaluating that is probably a good place to use SIMD.

Yes. The program actually includes an ONNX runtime, which uses SIMD to accelerate NN inference.
Post reply on HN