Skip to content

Instantly share code, notes, and snippets.

@MTuner
Last active August 16, 2024 09:02
Show Gist options
  • Select an option

  • Save MTuner/3ee1e24b58808b2cd6b17c3a176b832e to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

thanks, this was most helpful

@GarthSnyder

Copy link
Copy Markdown

OMG, so much better. Tx!

@wpp

wpp commented Sep 26, 2018

Copy link
Copy Markdown

Thank you very much!

@rcedwards

Copy link
Copy Markdown

🙏

@cmeury

cmeury commented Sep 27, 2018

Copy link
Copy Markdown

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

effata commented Sep 28, 2018

Copy link
Copy Markdown

Perfect, thanks so much!

@benpbolton

Copy link
Copy Markdown

🙏

@rluquero

Copy link
Copy Markdown

I love you

@jkmcrg

jkmcrg commented Oct 24, 2018

Copy link
Copy Markdown

sweet jesus thank you

@legendbb

legendbb commented Nov 6, 2018

Copy link
Copy Markdown

Best ever than any other system wide changes.

@svivian

svivian commented Nov 28, 2018

Copy link
Copy Markdown

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

auraz commented Jan 14, 2019

Copy link
Copy Markdown

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.

@chuggingCoffee

Copy link
Copy Markdown

Thank you!

@frou

frou commented May 23, 2019

Copy link
Copy Markdown

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
Copy Markdown

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

@bartkl

bartkl commented Nov 2, 2022

Copy link
Copy Markdown

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