8

Is there any way to get XCode to render text in the editor with anti-aliasing enabled? I can't see anything in the preferences dialog that would do it.

U62
  • 4,355
  • 1
  • 24
  • 37

4 Answers4

7

XCode text is already anti-alaised. Check to make sure the font size is larger than specified in:

System Preferences -> Appearance.

If it is larger than that you can try this command at the command line to edit the application setting for xcode.

defaults write com.apple.xcode AppleAntiAliasingThreshold -int <font-size>
defaults write com.apple.xcode AppleSmoothFontsSizeThreshold -int <font-size>
Adam Peck
  • 6,930
  • 3
  • 23
  • 27
  • I'm sure it's not anti-aliasing - and this is a fresh MacBook that's had nothing but Xcode loaded onto it so far. I tried your setting with a size of 4 (which is what the system prefs setting has by default) and it made no difference. I'll try posting a screenshot. – U62 Jan 01 '09 at 01:49
  • Try increasing your font size. If that makes it antialaised then there must be some other setting restricting it from doing it. – Adam Peck Jan 02 '09 at 15:30
  • This is perfect, thanks. Personally I like to disable anti-aliasing because it looks blurry. I set AppleAntiAliasingThreshold to a high value and I get exactly what I want. :) – Tom Jan 28 '11 at 23:49
4

The default code font in Xcode and Terminal is 10-point Monaco, which is traditionally not anti-aliased because there are hand-tuned bitmaps for this.

You can use the Fonts & Colors pane in the Xcode Preferences to have Xcode use whatever fonts, sizes and colors you prefer. For example, you could use 11-point Monaco or larger if you want anti-aliased text, or you could use one of a number of bitmap-only programming fonts at their native sizes if pixel-sharpness matters to you.

Personally, I rather like Courier 12 and Inconsolata 13 for coding. Courier comes with Mac OS X, while Inconsolata is a free monospaced font from Raph Levien.

Chris Hanson
  • 54,380
  • 8
  • 73
  • 102
  • Thanks! Being a Mac newbie it never occured to me that it depended on the size of the typeface - on Windows you enable cleartype and everything is anti-aliased forevermore. – U62 Jan 03 '09 at 21:59
  • It's not just based on the size of the typeface - it's based on both the size and the presence of a tuned bitmap version of the font at that size. – Chris Hanson Jan 04 '09 at 01:35
4

Just a hint: To change the font for all categories in xcode click inside the category table, press cmd+a and double click somewhere in the category table. The changes you apply in the Fonts dialog afterwards are applied to all categories.

Hope this helped

stigi
  • 6,661
  • 3
  • 40
  • 50
2

What you need to do to disable font anti-aliasing in Xcode has changed over ther years.

Currently, to turn off font anti-aliasing if you're running Xcode 4.6.x and OS X 10.8.x, run these two commands from a Terminal window:

defaults write com.apple.dt.Xcode NSFontDefaultScreenFontSubstitutionEnabled -bool YES
defaults write com.apple.dt.Xcode AppleAntiAliasingThreshold -int 24
John Jacecko
  • 1,870
  • 1
  • 16
  • 12