My team rewrote Apple's TrueType hinting interpreter in Swift, ask me anything.

Last year, my team shipped a Swift rewrite of Apple's TrueType hinting interpreter. The new code is strictly memory safe, relentlessly tested, and faster than the C code it replaced.

This year, it is my pleasure to ship it for a second time, now as an open source package, and to share our experience on the Swift blog: https://www.swift.org/blog/migrating-truetype-hinting-to-swift/

Swift at Apple: Migrating the TrueType Hinting Interpreter

TrueType is a widely used vector font standard for rendering text in web pages, PDFs, operating systems, and applications. Familiar fonts like Helvetica, Garamond, and Monaco are all built on TrueType outlines. The format specifies a hinting interpreter intended to help outlines rasterize faithfully on low-resolution displays. Modern high-resolution displays enable beautiful typography from outlines alone, but TrueType fonts that need hinting to render legibly remain in use and we continue to support them. Font parsers process data from untrusted sources, making the TrueType hinting interpreter a security-critical attack surface. To make the format more resilient on Apple platforms, we rewrote its hinting interpreter from C to memory-safe Swift for the Fall 2025 releases. In addition to memory safety, we also improved performance: on average, our Swift interpreter runs 13% faster than the C interpreter it replaced. To accompany this post, we’ve also published the source code of the Swift TrueType hinting interpreter. We hope sharing our experience helps others doing similar work in Swift.

Swift.org
@numist (for fall 2026 y? The blog says 2025 releases)
@numist ohh nvm I see now
@cbowns Yup! Sorry it took me so long to write about it.