Skip to content

Instantly share code, notes, and snippets.

@MTuner
Last active March 31, 2023 21:44
Show Gist options
  • Star 31 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save MTuner/3ee1e24b58808b2cd6b17c3a176b832e to your computer and use it in GitHub Desktop.
Save MTuner/3ee1e24b58808b2cd6b17c3a176b832e to your computer and use it in GitHub Desktop.
Fixing font rendering/aliasing in Sublime Text in MacOS Mojave
Apple removed colored sub-pixel antialiasing in MacOS Mojave
(https://developer.apple.com/videos/play/wwdc2018/209/ starting from ~28min)
To make fonts look normal in Sublime Text, add to Preferences:
// For the editor
"font_options": [ "gray_antialias" ],
// For the sidebar / other elements
"theme_font_options": [ "gray_antialias" ],
@gowrizrh
Copy link

thanks, this was most helpful

@GarthSnyder
Copy link

OMG, so much better. Tx!

@wpp
Copy link

wpp commented Sep 26, 2018

Thank you very much!

@rcedwards
Copy link

🙏

@cmeury
Copy link

cmeury commented Sep 27, 2018

Here's a copy-pasteable quickfix using jq:

pushd ${HOME}/Library/Application\ Support/Sublime\ Merge/Packages/User/ && \
  echo "$(cat Preferences.sublime-settings)" | \
  jq '. += {"font_options": [ "gray_antialias" ], "theme_font_options": [ "gray_antialias" ]}' | \
  dd of=Preferences.sublime-settings && \
  popd

@effata
Copy link

effata commented Sep 28, 2018

Perfect, thanks so much!

@benpbolton
Copy link

🙏

@rluquero
Copy link

I love you

@jkmcrg
Copy link

jkmcrg commented Oct 24, 2018

sweet jesus thank you

@legendbb
Copy link

legendbb commented Nov 6, 2018

Best ever than any other system wide changes.

@svivian
Copy link

svivian commented Nov 28, 2018

This didn't work well for me, it just made the fonts look the same as when font smoothing is disabled (thin and scratchy). Plus I was still getting blurry fonts in the Terminal. For me, running this command worked the best:

defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO

Now with font smoothing on in Mac preferences (and without the ST preferences above), everything looks fine!

@auraz
Copy link

auraz commented Jan 14, 2019

This didn't work well for me, it just made the fonts look the same as when font smoothing is disabled (thin and scratchy). Plus I was still getting blurry fonts in the Terminal. For me, running this command worked the best:

defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO

Now with font smoothing on in Mac preferences (and without the ST preferences above), everything looks fine!

That was true for me for some themes, default new themes worked fine.

@pdxmike
Copy link

pdxmike commented Apr 9, 2019

Thank you!

@frou
Copy link

frou commented May 23, 2019

The original Gist does not make sense to me.

Sub-pixel AA (i.e. coloured fringes) is what we want, and what was the default in macOS 10.13 and before. So why explicitly set Sublime to use Greyscale AA? That's just doubling down on choosing worse AA (explicitly setting it in Sublime even though it's what macOS 10.14 does out of the box anyway).


When using the "defaults write" mechanism, rather than affecting every app on the system, I think it's better to scope it to only affect particular apps you have issues with, e.g.

# Re-enable sub-pixel (as opposed to only greyscale) font AA on macOS 10.14+
defaults write com.sublimetext.3 CGFontRenderingFontSmoothingDisabled 0

p.s. It's not worth doing the above if you use a Retina/HiDPI display. Greyscale font AA looks fine at high DPI, which is probably why Apple chose to make their change. Though, I don't understand why they didn't limit it to only when a Retina display is being used.

@robmathews
Copy link

Thank you, I've been suffering with this for months.

@bartkl
Copy link

bartkl commented Nov 2, 2022

Oh wow, this helped me on Linux as well! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment