All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

TrueType Font Contains 3D Raycasting Engine in Hinting Virtual Machine

By

4RH1T3CT0R

1mo ago· 4 min readenCode

Summary

A developer created a DOOM-style 3D raycasting engine that runs inside a TrueType font's hinting virtual machine. The project exploits the Turing-complete nature of TrueType's hinting bytecode to implement a DDA raycasting engine that renders 3D graphics by repositioning glyph contours. The font file contains the entire raycasting engine written in TrueType bytecode, with the glyph 'A' using 16 vertical bar contours that are repositioned to form a 3D perspective view of a 16x16 tile map.

Key quotes

· 4 pulled
TrueType fonts have a built-in virtual machine for grid-fitting glyphs. It's got a stack, storage slots, arithmetic, conditionals, function calls - and it turns out it's Turing-complete.
I wanted to see if I could get it to render 3D graphics.
The font file contains a DDA raycasting engine written in TrueType bytecode.
The glyph 'A' has 16 vertical bar contours, and the hinting program raycasts against a 16x16 tile map and repositions those bars using SCFS instructions to form a 3D perspective view.
Snippet from the RSS feed
A 3D raycasting engine running inside a TrueType font's hinting virtual machine - 4RH1T3CT0R7/ttf-doom

You might also wanna read