A developer going by the handle jim.sh has dropped something genuinely unhinged on Hacker News: a TrueType font that renders QR codes inline during text shaping. No image generation, no preprocessing pipeline—just type bracketed text like [hello], apply the font, and watch Unicode characters arrange themselves into a scannable barcode. The project emerged from a late-night HN discussion where someone jokingly asked if anyone would "sacrifice their sanity for the sake of implementing a QR renderer as TTF hinting code." Apparently, yes.
How the Font Pulls This Off
The magic lives in OpenType rules baked directly into the font file. When your text editor or browser runs the text through its shaping engine, the bracketed content triggers glyph substitutions that arrange standard Unicode block characters into QR patterns. Because it's still technically text at the rendering stage, you can copy-paste the resulting "QR code" as plain characters, store it in a .txt file, or embed it inline with regular prose. Text outside brackets renders normally using Liberation Sans derivatives.
Three Tiers of QR Encoding
The project ships three font variants targeting different data capacities: QR Font 1-L handles up to 17 ASCII characters per bracketed block, QR Font 2-L stretches to 32 characters, and QR Font 3-L maxes out at 53. The "L" designation indicates Error Correction Level L, which offers minimal redundancy but maximizes raw storage. Users input printable ASCII inside square brackets, and the font handles layout automatically.
Browser Rendering Caveats
The project documentation flags a critical gotcha: browsers perform line-breaking on Unicode text before shaping occurs. If your QR code block contains break opportunities—spaces, dots, or slashes—and hits the edge of a container, the renderer may split it across lines and break scannability. The fix is straightforward: wrap bracketed blocks in containers styled with white-space: nowrap; or display: inline-block;. This forces the shaping engine to treat the block as an atomic unit.
Built With AI Assistance
According to the project description, the font was assembled using a combination of Gemini and GPT. The developer notes they "had some tokens to burn" while exploring whether the approach was even feasible—which, given the result, suggests frontier models are getting better at reasoning through font engineering edge cases.
Key Takeaways
- QR codes render as Unicode glyph arrangements during text shaping—no image pipeline required
- Resulting codes remain selectable, copyable, and storable as plain text
- Three capacity tiers available: 1-L (17 chars), 2-L (32 chars), 3-L (53 chars)
- Browser line-wrapping can break rendering; wrap QR blocks in nowrap containers
The Bottom Line
This is the kind of sideways hack that makes you wonder what other rendering magic is hiding inside font file specs. Whether this sees production use or stays a novelty, it demonstrates that text shaping pipelines are more flexible than most developers assume—and that's worth keeping in mind when your next project needs something weird.