"If one pastes Z80 opcodes into a word processor and changes their font to Z80 Sans, the codes are rendered as their assembly mnemonics. The font manages this by abusing the Glyph Substitution Table and Glyph Positioning Table, two components of the OpenType standard. Fonts define relations between characters (internal representations used by the computer, such as ASCII and Unicode) and glyphs (the graphics actually displayed).
In some cases, though, the way a character is displayed depends on where it appears in a word, or what appears around it (Arabic characters are a common example, but an example from English is the ligature “æ”). Z80 Sans defines all the possible glyphs for each nibble of the opcodes, then used a recursive descent parser to generate substitution rules which display the correct glyphs in context."
https://hackaday.com/2026/03/15/disassembling-opcodes-with-a-font/