Post-OpenType
Neural Network Fonts
Eli Heuer 2026
I make font tools. This talk is about a font that is a neural network.
Based on the blog post at elih.net/blog/nastaliq-distilled.
A dozen or so years ago, I was able to sit down with Eliyezer Kohen, one of the original inventors of OpenType Layout, and talk through the difficulties of cascading Arabic. He told me something that neither I nor any of my colleagues working with Arabic to that date had been aware of: he never expected OTL to be able to handle cascading Arabic, which he considered to be outside the scope of the technology. Unfortunately, this information was lost because Eliyezer had left Microsoft before OpenType became widely adopted. As Eliyezer put it to me at the end of our conversation, he had been happy in the mid-1990s to target 98% of the world with OTL and for Tom Milo to have the rest.
A lot of time and effort has been wasted over the years trying to force cascading Arabic into OTL.
John Hudson, TypeDrawers, July 31
typedrawers.com/discussion/comment/72005
John Hudson, on talking with Eliyezer Kohen, one of the inventors of OpenType Layout.
A relatively nonlinear and freeform style of the Perso-Arabic script. A calligrapher can stack words, extend strokes, and move letters and dots to balance black and white space.
Of all the major styles it is the one worst served by OpenType.
You do not need to read Nasta’liq. Look for the differences between the two sides.
The same two lines, closer. Look at how the calligrapher stacks, stretches and spaces them.
This is what people buy and hang on the wall. The same line as the calligraphy, set as type.
A small feed-forward network: Unicode and neighbors in, a signed distance field out.
1.36 million weights: 5.4 MB at 32 bits, 1.38 MB quantized to 8
No OpenType shaping at runtime
Rust, WASM, Linebender, img2bez
| OpenType | NeuralType | |
|---|---|---|
| Unit | Glyph in a box | Shape from context |
| Behavior | GSUB, GPOS | Learned |
| File | Outlines, tables | Weights |
| Engine | HarfBuzz | NeuralType |
Distilled from Gulzar: 91,390 examples from 30,783 strings of one to three letters, 1,150 distinct shapes.
Rust and Candle on an NVIDIA RTX 2060 SUPER with 8 GB. About 100 seconds per epoch.
Validation IoU 0.945 on held-out short strings.
Training and inference both run locally. Independent designers can do this with full control of their data.
IoU: overlap divided by union. 1.0 is identical. It measures shape, not position, and not new words.
A fast tracer draws while you type. When input settles, img2bez replaces it with a cleaner Bézier outline in a Web Worker.
Here img2bez traces a raster glyph. In the font it reads the field directly.
Hold space over the demo to flip structure and preview. Esc, then →.
Distillation shows this is possible.
It is not the right design.
The model copies a font that was built for movable-type thinking: one glyph in one box, with rules between boxes. Distilling it carries those limits into the network.
Runebender
Switch to Runebender now. About two minutes.
Trained from the labeled .nufo alone. No OpenType font, no starting weights.
Drag the end of بب. The font draws the ب between the short and long drawings.
Thank you
elih.net/blog/nastaliq-distilled
runebender.org
github.com/eliheuer/post-opentype
eli@elih.net