August 21st, 2024

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

The handwriter.ttf GitHub repository features a handwriting synthesizer using a compact RNN model, requiring Linux with X11, and activates in gedit with lines starting with `#`.

Read original articleLink Icon
CuriosityExcitementConfusion
Show HN: Handwriter.ttf – Handwriting Synthesis with Harfbuzz WASM

The GitHub repository **handwriter.ttf** features a handwriting synthesizer that employs the Harfbuzz WASM Shaper. The project aims to generate handwriting-style fonts in real-time using a compact recurrent neural network (RNN) model, which is approximately 14 MiB in size. It draws inspiration from the llama.ttf project and investigates the capabilities of WASM shapers for font synthesis. To use the project, users must clone the repository on a Linux system with X11, navigate to the directory, and run the project. Typing in the pop-up gedit window requires each line to start with a `#` to activate the shaper. The underlying RNN model is based on Alex Graves's research, and the project utilizes Bresenham's line algorithm for stroke rasterization, achieving a character generation speed of 0.08 seconds on an Intel Ultra 125H. Additional resources include a demonstration video on YouTube and related projects like Harfbuzz-WASM-Fantasy. The project is licensed under the Apache 2.0 License.

- The project synthesizes handwriting-style fonts using a lightweight RNN model.

- It requires a Linux system with X11 for installation and usage.

- Users must prefix lines with `#` in gedit to trigger the handwriting synthesis.

- The RNN model is inspired by Alex Graves's research on sequence generation.

- The project is licensed under the Apache 2.0 License.

AI: What people are saying
The comments on the handwriting synthesizer reveal a mix of curiosity, skepticism, and appreciation for the technology.
  • Many users express confusion about the functionality and practical applications of the synthesizer.
  • Some commenters highlight the potential for using this technology in creative or deceptive ways, such as faking documents.
  • There is a desire for better development tools for handwriting input in programming environments.
  • Several users are impressed by the underlying technology, particularly the use of RNNs and real-time font synthesis.
  • Some comments reflect a humorous or critical take on the future of fonts and their implications.
Link Icon 19 comments
By @PhilipRoman - 8 months
I bet this is what people felt when JavaScript was first demoed on the web.

In the year 2077, when each font will run it's own virtual machine on WASM containing a "minimal" Ubuntu image, some enlightened blogger will suggest server side rendered fonts as a performance improvement.

By @pjmlp - 8 months
Nice demo.

Without trying to steal the thread, what I would care is actually the opposite direction.

Neither in Swift Playgrounds, nor in any other programming development environment apps for both mobile OSes, have I found a good development experience using pen instead of keyboard.

Given how many of us "program" in paper notebooks, it is quite incredible that besides a couple of research projects done by PhD students, no one cares to actually make it more widespread in a usable way.

By @tombh - 8 months
I've read the README and watched the video, but I'm still not sure what this is doing? I know it can "synthesize [a] font at runtime", so does that mean it's creating a random handwritten font as you type? But it's not based on the user's handwriting?
By @gwern - 8 months
This looks like it'd be quite useful for faking documents more convincingly. Existing handwriting fonts always have tell-tale regularities and there's so few that forensics analysis exposes them easily.
By @jcelerier - 8 months
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?
By @fulafel - 8 months
I wondered why there's just a video and no demo. But does it require the new wasm features in the browser ttf support?
By @BigParm - 8 months
Wtf is happening here what are the inputs and outputs? Hard to tell what this program does for me
By @kragen - 8 months
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?

By @vintermann - 8 months
So you trained a THAT small RNN to make this good handwriting? I'm actually even more impressed at that than at the crazy pipeline turning it into a font in realtime.
By @calebj0seph - 8 months
Damn, this is impressive!

We built a WebGL text renderer with full CJK support using Harfbuzz for our production whiteboard web app. I thought that was complicated until now.

By @adzm - 8 months
I've been curious about seeing if harfbuzz etc could help create a styled Elianscript font but not really sure where to start.
By @eigenvalue - 8 months
Fun hack. I bet Alex Graves never in a million years anticipated that his PhD thesis work would be encapsulated in a novelty font.
By @a1o - 8 months
I don't get it, why there's no link to a GitHub pages website to test the thing?
By @einpoklum - 8 months
OP's repository has a Makefile which assumes a docker daemon is available.
By @andrewmcwatters - 8 months
It visually fails to preserve “handedness.”
By @piyushtechsavy - 8 months
Nice demo, for sure a fun app.
By @a2128 - 8 months
Link to llama.ttf, another fun font that abuses HarfBuzz for anyone interested (it runs a language model inside a font): https://fuglede.github.io/llama.ttf/

The llama.ttf video does a pretty good job explaining what the heck is going on

By @cyberax - 8 months
Year 2045: fonts become self-aware and go on a strikethrough.
By @dancemethis - 8 months
This is so cursed, there is so much that begs the question - "why?"...

I love it.

I can't wait for the next beautiful nightmare. Maybe someone should mix font rendering with PDF rendering. Of course, with a LLM doing something in the middle.