Live data from Hacker News

Swift at Apple: Migrating the TrueType hinting interpreter

swift.org

61–70 of 139 posts

Re: Swift at Apple: Migrating the TrueType hinting interpreter

#61

Earlier quoted context omitted.

macOS has been drawing unhinted text for an eternity, and for those who can tolerate it on low-DPI screens, it's a great thing: the letter shapes look the same at all sizes, and the spacing between letters is consistent at all sizes.

I'm a high DPI snob so I haven't used a low res monitor for work in forever, but isn't the entire point of font hinting to make the text more legible at smaller pixel grid sizes? Yes, of course the shapes are more consistent since the hinter isn't touching them, but isn't the end result just less legible text?

Hinting purposefully destroys letter shapes in exchange for crispness. People who like macOS style font rendering prioritize letter shapes faithful to the font designer more than crispness.

Whether good letter shapes is more legible or crisper text is more legible is basically subjective. In the 2000s before HiDPI became popular different people really thought one was more legible than the other and vice versa. HiDPI made this basically moot.

Re: Swift at Apple: Migrating the TrueType hinting interpreter

#62
If you want to help improve the security of OS software through the magic of memory safe languages, the team that did this work is hiring: https://jobs.apple.com/en-us/search?search=Spear&sort=releva...

Knowledge of Swift not required. If you know your way around OS software, can reason about the security of the code you write, and are excited about writing exhaustively tested software, we’d love to talk to you.

We’re hiring for roles in kernel/systems and userspace. Like the Platforms SOTU mentioned, we’re using Swift at all layers of the software stack now. https://www.youtube.com/live/yl2jsIoMfDU

I had the pleasure of leading the effort to ship Swift in the Secure Enclave back in 2022. Now I have multiple teams working on accelerating the transition to memory safe languages. We’re showing that with good planning and a relentless focus on testing, we can improve security, performance, and functionality. And we get to have a ton of fun working with some amazing colleagues. It’s the most enjoyable and impactful work I’ve ever done in my career.

Re: Swift at Apple: Migrating the TrueType hinting interpreter

#64
Beware: As of a few months ago, when I tried to use the lifetime features shown off in this post, I ran into constant compiler crashes with very simple programs, until I gave up and wrote off the features as unusable. This happened on both stable and nightly compilers. I guess they work well enough for this TrueType interpreter, but I suspect they’re using a narrow subset of what the features are supposed to support. Or maybe things have been fixed very recently.

That said, I’m looking forward to using Swift lifetimes once they actually work!

Re: Swift at Apple: Migrating the TrueType hinting interpreter

#65
post #64

Beware: As of a few months ago, when I tried to use the lifetime features shown off in this post, I ran into constant compiler crashes with very simple programs, until I gave up and wrote off the features as unusable. This happened on both stable and nightly compilers. I guess they work well enough for this TrueType interpreter, but I suspect they’re using a narrow subset of what the features are supposed to support.…

The work discussed in this post shipped in the OS last year (fall 2025), so nothing here is dependent on very recent changes.

Re: Swift at Apple: Migrating the TrueType hinting interpreter

#67
post #38

Earlier quoted context omitted.

My last 1080p monitor was around 20 years ago. I have trouble comprehending people still use them regularly.

The problem is, as soon as you are not on a Mac but Linux or Windows, you are in for an awful, truly awful lot of pain. HiDPI support is a mess because even in the rare case applications are made with HiDPI in mind they are not tested on HiDPI machines. Other way around, most Mac software is not tested how it behaves on inferior external monitors.

What kind of windows programs are these? HiDPI is more than a decade old. A desktop application, no matter what OS it is, should always be tested with different scaling factors.

Re: Swift at Apple: Migrating the TrueType hinting interpreter

#68

What's funny is from 2023 (I think), macOS just draws the UI unhinted. You have a 1080p display and you don't want to see the letters in the UI blurred to death? Tough luck, 1080p is incompatible with macOS, everybody needs "retina", and nobody cares that Windows and all Linux DEs look on 1080p just fine. It looks like this hinter will be used only in rendering PDFs, because that's where they test the performance.

While hinting is disabled for most fonts, there are some fonts that require hinting to render correctly. We have to support hinting for those fonts, and it was easier to make it secure by rewriting hinting in Swift than it would have been to comprehensively identify every font created by those foundries.

Re: Swift at Apple: Migrating the TrueType hinting interpreter

#69
post #55

Earlier quoted context omitted.

Swift and Rust were developed at similar times. I think of them more as having similar influences than borrowing from each other.

There’s no reason to invent your own head canon, the influence was openly acknowledged when Swift was new and it continues now that the language is developed out in the open (see Swift Ownership Manifesto)

Obviously Rust was first but over time both languages have been taking inspiration from each other. For example let-else was motivated directly because of its success in Swift: https://rust-lang.github.io/rfcs/3137-let-else.html#prior-ar...
Post reply on HN