frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: TTF-DOOM – A raycaster running inside TrueType font hinting

https://github.com/4RH1T3CT0R7/ttf-doom
23•4RH1T3CT0R•5h ago
TrueType fonts have a hinting VM that grid-fits glyphs. It has a stack, storage area, conditionals, function calls, and it turns out it's Turing-complete. So I built a raycasting engine in the hinting bytecode.

The glyph "A" in the font has 16 vertical bar contours. The hinting program reads player coordinates from font variation axes via GETVARIATION, does DDA ray marching against a tile map in the storage area, and repositions bar heights with SCFS. It ends up looking like a crude Wolfenstein-style view.

Small visuzlization: https://github.com/4RH1T3CT0R7/ttf-doom/blob/main/docs/media...

About 6.5 KB of bytecode total - 13 functions, 795 storage slots, sin/cos lookup tables.

JS handles movement, enemies, and shooting, then passes the coordinates to the font through CSS font-variation-settings. The font is basically a weird GPU.

The weirdest parts: - TrueType MUL does (ab)/64, not ab. So 1*4=0. The DIV instruction is equally cursed. - No WHILE loops. Everything compiles to recursive FDEFs. FreeType limits call depth to ~64 frames. - SVTCA[0] is Y, SVTCA[1] is X. Of course.

There's a small compiler behind this - lexer, parser, codegen - that turns a C-like DSL into TT assembly.

Demo GIF: https://github.com/4RH1T3CT0R7/ttf-doom/blob/main/docs/media...

Live demo: https://4rh1t3ct0r7.github.io/ttf-doom/ (Chrome/Edge, WASD+arrows, Space to shoot, Tab for debug overlay)

This is a DOOM-style raycaster, not a port of the original engine - similar to DOOMQL and the Excel DOOM. The wall rendering does happen in the font's hinting VM though. Press Tab in the demo to watch the font variation axes change as you move.

Comments

emanuele-em•3h ago
Ok the MUL workaround got me. MUL does (ab)/64 so you have to DIV first to get a64, then MUL finally gives you a*b. And recursive FDEFs because there's no WHILE? All in 6.5KB? What kind of frame rate do you actually get out of this?
4RH1T3CT0R•3h ago
Frame rate depends on the browser - Chrome gives around 30-60fps on my machine, but the bottleneck is actually Chrome deciding whether to re-run hinting at all (had to add axis jitter to force it). The TT bytecode itself executes fast, it's maybe a few thousand instructions per frame

  The recursive FDEF thing is the worst part honestly. Every while loop is a function that calls itself, and FreeType kills you at ~64 deep. So you're constantly juggling how many columns vs how many ray steps you can afford
tombert•1h ago
I tried playing the demo, and it was just green bars for me. The walls didn't scale up or shrink, it was just a bunch of solid static green bars.

The enemies did scale up and shrink as I got closer, and the minimap worked.

Tried with Brave on Linux, and Google Chrome on macOS.

tadfisher•1h ago
You are (or I suspect your LLM is) not correct about Doom using a raycasting engine. Wolfenstein fits that description, yes. Doom rather famously introduced BSP for level data and it draws sorted polygons front-to-back without ray-marching.

Show HN: Ghost Pepper – Local hold-to-talk speech-to-text for macOS

https://github.com/matthartman/ghost-pepper
212•MattHart88•4h ago•97 comments

Show HN: GovAuctions lets you browse government auctions at once

https://www.govauctions.app/
201•player_piano•8h ago•63 comments

Show HN: Hippo, biologically inspired memory for AI agents

https://github.com/kitfunso/hippo-memory
36•kitfunso•2h ago•13 comments

Show HN: Tusk for macOS and Gnome

https://shapemachine.xyz/tusk/
44•factorialboy•2d ago•15 comments

Show HN: Anos – a hand-written ~100KiB microkernel for x86-64 and RISC-V

https://github.com/roscopeco/anos
16•noone_youknow•2d ago•5 comments

Show HN: TTF-DOOM – A raycaster running inside TrueType font hinting

https://github.com/4RH1T3CT0R7/ttf-doom
23•4RH1T3CT0R•5h ago•4 comments

Show HN: Docking – Extensible Linux dock in Python

https://docking.cc
21•edumucelli•2d ago•5 comments

Show HN: Physical constants from 2 integers – MIT, 1225 tests, falsifiable

https://bpr.thestardrive.com
2•iq19zero•56m ago•0 comments

Show HN: I built a tiny LLM to demystify how language models work

https://github.com/arman-bd/guppylm
840•armanified•1d ago•126 comments

Show HN: Real-time AI (audio/video in, voice out) on an M3 Pro with Gemma E2B

https://github.com/fikrikarim/parlor
261•karimf•1d ago•30 comments

Show HN: Weird Clocks

https://clocks.specr.net
22•vunderba•9h ago•10 comments

Show HN: Gemma Gem – AI model embedded in a browser – no API keys, no cloud

https://github.com/kessler/gemma-gem
142•ikessler•1d ago•20 comments

Show HN: MemberLane – Paid Communities on Telegram, Discord, and WhatsApp

https://www.memberlane.app
2•grene98•2h ago•0 comments

Show HN: CacheZero – Karpathy's LLM wiki idea as one NPM install

3•swarajbachu•2h ago•0 comments

Show HN: I made a YouTube search form with advanced filters

https://playlists.at/youtube/search/
303•nevernothing•1d ago•194 comments

Show HN: Meta-agent: self-improving agent harnesses from live traces

https://github.com/canvas-org/meta-agent
5•essamsleiman•5h ago•0 comments

Show HN: I built a site that turns your Steam gaming hours into a RL skill tree

https://alternatelife.xyz/
5•naorz•3h ago•0 comments

Show HN: Modo – I built an open-source alternative to Kiro, Cursor, and Windsurf

https://github.com/mohshomis/modo
93•mohshomis•1d ago•18 comments

Show HN: ReverseCam – See yourself as others see you

https://www.reversecam.com
7•ilamparithi•9h ago•1 comments

Show HN: Splice CAD – Wiring and cable assembly CAD with an agentic assist

https://splice-cad.com/
3•djsdjs•4h ago•0 comments

Show HN: A game where you build a GPU

https://jaso1024.com/mvidia/
945•Jaso1024•2d ago•181 comments

Show HN: Kept for the children and machines that come after

https://www.latentdiaries.com/
2•ainthusiast•5h ago•1 comments

Show HN: I just built a MCP Server that connects Claude to all your wearables

https://pacetraining.co/
14•anton_salcher•15h ago•12 comments

Show HN: OsintRadar – Curated directory for osint tools

https://osintradar.com/
81•lexalizer•1d ago•9 comments

Show HN: M. C. Escher spiral in WebGL inspired by 3Blue1Brown

https://static.laszlokorte.de/escher/
172•laszlokorte•2d ago•28 comments

Show HN: Vajra, a background coding agent with graph-based workflows

https://github.com/zamana-inc/vajra
2•shloked•7h ago•0 comments

Show HN: I replaced Google Analytics with my own tool – no cookies, <1KB script

https://datakool.com/
11•VictorChanet•13h ago•8 comments

Show HN: Contrapunk – Real-time counterpoint harmony from guitar input

https://contrapunk.com/
116•waveywaves•2d ago•54 comments

Show HN: Tiny TUI for disk usage exploration

https://github.com/dhbradshaw/syz
4•dhbradshaw•9h ago•5 comments

Show HN: MCP 2000 – Browser-based drum machine with AI-generated sounds

https://www.mcp2000.com/
3•harmoni-pet•9h ago•0 comments