Is there a way to disable subpixel antialiasing for a single application written in Cocoa, programmatically or otherwise. I can set the global user defaults to set the level, even force it on for an external monitor, but I need a solution per-app that I can also distribute to others.
Asked
Active
Viewed 816 times
1 Answers
2
NSUserDefaults works by domains, so each NSUserDefault can have a system-wide value, an app-wide value, and so on. If you're able to set the global user defaults for this, simply instead set the same NSUserDefaults for your app only.
What's the NSUserDefaults key you are using and how do you set it?

AliSoftware
- 32,623
- 6
- 82
- 77
-
I did try that but it did not seem to work at the application level. For the global domain I was using: defaults -currentHost write -globalDomain AppleFontSmoothing -int 1 – happycodelucky Sep 08 '11 at 21:36
-
@pryomoax: That's one of the three forms of “on”. http://hints.macworld.com/article.php?story=20090828224632809 You want `-int 0`. Also, note that you can't set defaults for an application that is already running; it won't notice the change and may clobber it at quit. You must quit it, then set the default. – Peter Hosey Sep 09 '11 at 04:24
-
Add this to your main function (main.m), before calling NSApplicationMain: `[[NSUserDefaults standardUserDefaults] setValue:[NSNumber numberWithInt:0] forKey:@"AppleFontSmoothing"];` – Vojto Nov 28 '11 at 08:22
-
I would consider using `NSUserDefaults`' `registerDefaults:` method then (instead of `setValue:forKey:`) which is more suitable for a default value not overridden by the user itself but forced by the app – AliSoftware Nov 28 '11 at 14:19