[KongchangAI]
· 2 min read· 1,007 words

Hacking Mixed Fonts with OpenType Ligatures: The Tech Behind Times New Bastard

Hacking Mixed Fonts with OpenType Ligatures: The Tech Behind Times New Bastard

A viral joke font tool that abuses OpenType ligatures to mix typefaces, running entirely in the browser via WASM + Python.

Times New Bastard is a playful project that went viral on Hacker News by repurposing OpenType ligature substitution rules — normally used to beautify typography — into a cross-font glyph mixing mechanism, producing deliberately chaotic visual effects. On the engineering side, it runs entirely in the browser using WebAssembly to execute Python (via Pyodide and fonttools), enabling instant font generation with no backend required. Its appeal lies both in the creative misuse of an obscure low-level feature and as a vivid example of WASM steadily expanding the boundaries of what the web platform can do.

A Tool That Breaks Fonts for Fun

On Hacker News, a project called "Times New Bastard" unexpectedly racked up 287 upvotes and 44 comments. Its premise is straightforward — a joke tool that "breaks" fonts by mashing multiple typefaces together, producing all manner of cursed, chaotic typography.

The name itself is a parody of the classic typeface Times New Roman, and you can feel the author's sense of humor just from the title. But what actually caught the tech community's attention wasn't how absurd it looked — it was the technical approach used to pull it off.

Cleverly Abusing OpenType Ligatures

The core idea behind the tool is to "abuse" (the author's own word) the ligature feature built into the OpenType font format.

Ligatures were originally an elegant typographic design: when certain character combinations appear, the font engine automatically substitutes them with a specially designed merged glyph. The most familiar examples are combinations like "fi" and "fl", which in high-quality fonts are rendered as a single, more visually harmonious symbol that avoids awkward collisions between letterforms.

Times New Bastard flips this on its head, repurposing a mechanism designed to beautify typography into a tool for mixing glyphs from entirely different fonts. By manipulating the ligature rules in the OpenType feature tables, it can make characters within the same block of text take on forms drawn from different typefaces — producing visual chaos that feels deliberately wrong. This spirit of "using serious technology for unserious purposes" is precisely why it resonated so strongly with the developer community.

OpenType is a font format standard jointly developed by Microsoft and Adobe in the late 1990s, and has since become the dominant format for both desktop and web typography. Its power lies in a built-in programmable Feature Table system, which allows type designers to define complex typographic rules through two core tables: GSUB (Glyph Substitution) and GPOS (Glyph Positioning). Ligatures are one category of substitution rule within the GSUB table: when the font engine scans a specific sequence of characters, it maps multiple code points to a single composite glyph according to the defined rules. Beyond ligatures, OpenType feature tables also support small caps, superscripts and subscripts, stylistic alternates, contextual substitutions, and dozens of other typographic features. The cleverness of Times New Bastard lies in repurposing the GSUB substitution mechanism — originally designed for "multiple characters in → one beautified glyph out" — into a cross-font mapping of "one character in → a glyph from a different font out," effectively enabling multi-font rendering within a single font file.

Instant Results via Client-Side WASM

Beyond the creative concept, this project has a noteworthy engineering highlight: it runs entirely on the client side, and it's fast.

The author notes that the tool uses WebAssembly (WASM) to load Python in the browser to handle all font processing. This means all font generation and synthesis logic executes locally in the user's browser, with no backend server required.

This architecture has several immediate benefits:

  • Instant responsiveness: No network round-trips; user interactions get near-real-time feedback
  • Privacy-friendly: Data never leaves the local machine; no fonts or text need to be uploaded to a server
  • Lightweight deployment: No backend compute to maintain; a purely static host is sufficient

Running Python in WASM — typically via toolchains like Pyodide — has matured considerably in recent years, allowing developers to move server-side Python logic directly into the browser. Times New Bastard is a vivid small-scale example of this trend: a font manipulation task that might otherwise have required server-side processing has been stuffed entirely into the client.

Pyodide is an open-source project initiated by Mozilla in 2019. Its core is a compilation of the CPython interpreter and the scientific Python ecosystem (NumPy, Pandas, etc.) into WebAssembly bytecode, allowing them to run inside the browser sandbox. In font processing scenarios, Pyodide is typically used alongside the fonttools library — the most mature OpenType font parsing and construction tool in the Python ecosystem, capable of reading and writing the binary structure of font files, modifying GSUB/GPOS rule tables, and repackaging them into new fonts. The execution chain in the browser roughly looks like this: user triggers an action → JavaScript calls a Python function exposed by Pyodide → Python/fonttools performs glyph mixing and font reconstruction → the generated font file is injected into the page CSS as a Blob URL → the browser instantly renders the new font. The main latency bottleneck in this pipeline is the initial load of the Pyodide runtime (a WASM module of several megabytes); once initialized, subsequent font operations run at speeds close to native Python.

What a Joke Tool Can Teach Us

On the surface, this is just a toy project good for a laugh. But its ability to earn nearly 300 upvotes on Hacker News says something about the tech community's appreciation for "creative misuse."

OpenType ligatures — a low-level feature most people never think about — were here exploited in a way completely outside their intended purpose, producing something wholly unexpected. Projects like this aren't valuable because they're useful. They're valuable because they demonstrate a deep understanding of technical detail, and the ability to translate that understanding into something playful.

At the same time, the client-side WASM + Python approach reinforces just how far the Web platform's capabilities continue to expand. An increasing number of complex computations that once required backend support are being migrated to run directly in the browser. For developers, this lowers the barrier to shipping small tools like this, and opens up new imaginative possibilities for what "frontend-only" can mean.

Wrapping Up

Times New Bastard is a quintessential "Show HN" project: the technology isn't complicated, the idea is genuinely fun, and the implementation happens to touch on technical trends the community actually cares about. It's a reminder that even a field as seemingly mature and settled as font typography still has room to be reinterpreted and creatively exploited — as long as you're willing to "abuse" the forgotten features lurking underneath.

#OpenType ligatures#Times New Bastard#WebAssembly Python#Pyodide fonttools#font hacking#GSUB substitution#browser-side font generation
Share:

Related articles