Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Xcode anti-aliasing text inside the code editor?

When using Xcode, there doesn't seem to be a way to set code editor fonts to be sharp (i.e. with no 'font smoothing). Despite what you might see in the preview area of Preferences > Fonts & Colors, inside the actual code view it’s always smoothed/anti-aliased.

There are some older questions that address previous versions of Xcode. They suggest changing various settings using defaults write com.apple.dt.Xcode <etc>, but these do not seem to affect the code view for me in Xcode 5 on Mac OS X 10.8.5. I am using a dual-display setup with one Retina and one non-Retina screen.

I've tried turning off the font smoothing checkbox in System Preferences > General > "Use LCD font smoothing where available", but that only affects sub pixel rendering...

Update (2014-11-25): The problem still occurs with Mac OS X 10.10.1 and Xcode 6.1.1. Here is a screenshot showing the editor view (smoothed) and preferences window (unsmoothed) after using these Terminal commands:

defaults write com.apple.dt.Xcode NSFontDefaultScreenFontSubstitutionEnabled -bool YES
defaults write com.apple.dt.Xcode AppleAntiAliasingThreshold 16

Xcode

like image 533
Michael Tsai Avatar asked Sep 26 '13 18:09

Michael Tsai


People also ask

How do I disable font smoothing on Mac?

If you are currently on macOS Catalina (10.15) or below, you can remove the text smoothing by: Open System preferences and Appearances. Uncheck the checkbox next to “Use LCD font smoothing when available.”

How can I tell if font is smoothing enabled?

Open the Control Panel. Double-click the Display icon. In the Display menu, click the Effects tab and check the box on smooth edges on-screen fonts.


2 Answers

From Xcode9.3, text anti-aliasing can be disabled in the source editor by running the following command and restart Xcode:

defaults write com.apple.dt.Xcode SourceEditorDisableAntialiasing -bool YES

To turn anti-aliasing on again -

defaults write com.apple.dt.Xcode SourceEditorDisableAntialiasing -bool NO
like image 63
Vineet Choudhary Avatar answered Oct 19 '22 10:10

Vineet Choudhary


If you use a non-retina display, try

defaults write com.apple.dt.Xcode NSFontDefaultScreenFontSubstitutionEnabled -bool YES
and restart XCode.

UPDATE:

Also invoke this:

defaults write com.apple.dt.Xcode AppleAntiAliasingThreshold 24
like image 29
i_am_mushroom Avatar answered Oct 19 '22 09:10

i_am_mushroom