Why do my Xcode default font starts to look ugly after some time, until I restart?

5

3

  • I plugged in an external monitor.
  • All resolutions match perfectly.
  • MacBookPro LCD is closed.
  • After restarting Xcode editor fonts look very bad. Only in Xcode.
  • When I restart the mac and DON'T use an external monitor, fonts look all right again.
  • When I attach the monitor and close the LCD of the MacBookPro, fonts look nice.
  • Then I close Xcode and reopen it: Fonts suck.
  • Only way to get fonts look good is to disconnect external monitor and reboot, then reconnect external monitor, close LCD, wait, hit any key and let the external monitor be the only one. Fonts look nice - until I restart Xcode. I think it happens any time Xcode is launched with external monitor attached and ugly fonts survive until reboot. Unplugging external monitor and restarting Xcode doesn't help.

It seems like Xcode isn't antialiasing them properly after something happens.

Is there a fix for this problem?

EDIT: After trying a few more times, it seems it is possible to get fonts to look nice by disconnecting external monitor and reopening xcode.

Here are some little snapshots:

GOOD FONT:

alt text

UGLY FONT:

alt text

You can see how dirty the ugly font looks. It's very hard to read and hurts in the eyes. Believe me. It sucks. Sometimes the little "i" are almost invisible.

I make use of the very eye-friendly Dusk style of Xcode (go to preferences and choose that, if you haven't already. A real pleasure for your eyes)

mystify

Posted 2010-05-12T20:50:30.640

Reputation:

2Sounds like an apple bug. – user35583 – 2010-05-12T20:51:11.310

If you leave it open, does it still happen? – None – 2010-05-12T20:52:03.167

havent tried yet, but will report here what happens then... I observed the last time that it happend exactly right after restarting xcode. – None – 2010-05-12T21:01:37.327

Answers

3

I am assuming you are using Snow Leopard. Try this from a terminal

defaults -currentHost write -globalDomain AppleFontSmoothing -int 3

and then restart XCode. Changing the 3 at the end will control how much anti-aliasing happens on the fonts and may range from 0-3 I believe. 0 being off, 1 being light anti-aliasing and 3 being heavy anti-aliasing. The OS should also remember this setting for your monitor so you should only have to change it once.

This is a bug in Snow Leopard. This could be changed in system preferences prior to 10.6 but now 10.6 tries to figure out the best setting for your monitor on its own and does not get it right most of the time.

Brad S

Posted 2010-05-12T20:50:30.640

Reputation:

ineresting. from where do you have that info? and what's the dafault, in case I screw up all my fonts with this? – None – 2010-05-13T10:47:06.613

I had the same problem after upgrading to Snow Leopard. It was really bugging me so I did some googling. I think I found the info at www.macosxhints.com – None – 2010-05-13T13:22:04.027

You can run 'defaults delete -g AppleFontSmoothing' to return to the default if you want. – None – 2010-05-13T15:19:54.610

@Brad: Thanks, I just added an external monitor to my aging MBP got bit by this problem. I thought it was a problem with my MBP hardware trying to drive a high-res external monitor, but it seems that this mostly solved the issue.

Have people filed a bug for this? Is there an active radar issue we should all get behind (I think we can vote for them, right?)

Thanks again! – Steve Lianoglou – 2010-07-08T02:25:00.593

0

The "ugly font" is non-subpixel antialiasing; the "good font" is subpixel antialiasing (note the colored fringes). I doubt this has anything to do with Xcode specifically. Just pick a font smoothing style from System Preferences > Appearance and don't let it be set to "Automatic".

If you notice, Automatic is "best for main display"; there's no way to get different AA styles on your different displays. These days, this is mostly a relic from the time when people had one LCD and one CRT display. I would suggest filing a bug, though.

Nicholas Riley

Posted 2010-05-12T20:50:30.640

Reputation: 260

In SysPref > Appearance there are only two settings: "Activate LCD-Antialiasig if available" and "Don't antialias if font is [4] or smaller". 4 is the smalles possible value. I have russian mac. Tried to translate it. – None – 2010-05-13T10:44:50.707

See Brad S's response - the manual controls (which I describe) were removed in Snow Leopard but you can still adjust them with defaults. I happened to be writing from a Leopard machine and had forgotten. – None – 2010-05-13T15:19:09.230