Sublime Forum

Dev Build 3178

#21

Well, I don’t mind if ST is uncompliant. The font on Safari and other apps are still the same as pre Mojave. ST should be too.

0 Likes

#22

So Sublime Text uses Core Graphics and Core Text to render glyphs so that our font rendering matches the rest of the OS. This is opposed to using a third-party library, which would result in font rendering that looks different than the rest of the OS.

In Mojave, Apple appears to have by default removed subpixel antialiasing. That means that fonts will look different, especially on non-retina screens. I believe there are OS-level settings that can tweak the rendering, and may even allow re-enabling subpixel antialiasing.

Sublime Text uses the Apple APIs and renders the results. One of the changes that Apple appears to have made is that previously the anti-aliasing was only dependent on the x-position of characters. With Mojave, since subpixel antialiasing is turned off by default, now the background color also is factored in when antiliasing. This allows the contrast between the background and foreground to be perceptually tweaked. Again, the Apple APIs deal with this. We just have to cache both light and dark BG versions of characters.

From what you’ve said, it sounds like Apple has a private API or undisclosed algorithm they are using for Safari web page content. Currently it appears this “secret sauce” is not known. Source: https://bugs.chromium.org/p/chromium/issues/detail?id=858861#c33. Google isn’t sure what Apple is doing to get these results. They came up with a patch, but it is just an approximation.

For now we are using the APIs Apple has provided. Generally it appears we are producing “correct” text, as compared to various Apple apps, however it does appear that Apple has some inconsistencies in their own text rendering. We’ll definitely be keeping an eye on developments related to this and seeing if there is anything else we can expose to the user to customize rendering.

5 Likes