epoger@google.com | 7bc13a6 | 2012-02-14 14:53:59 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #import <Cocoa/Cocoa.h> |
| 9 | |
caryclark@google.com | 1313086 | 2012-06-06 12:10:45 +0000 | [diff] [blame] | 10 | // FIXME: should be in a header |
| 11 | void setSystemPreferences(); |
| 12 | |
epoger@google.com | 7bc13a6 | 2012-02-14 14:53:59 +0000 | [diff] [blame] | 13 | void setSystemPreferences() { |
| 14 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; |
| 15 | |
| 16 | // Set LCD font smoothing level for this application (does not affect other |
| 17 | // applications). Based on resetDefaultsToConsistentValues() in |
| 18 | // http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm |
caryclark@google.com | 1313086 | 2012-06-06 12:10:45 +0000 | [diff] [blame] | 19 | enum { |
| 20 | NoFontSmoothing = 0, |
| 21 | LightFontSmoothing = 1, |
| 22 | MediumFontSmoothing = 2, |
| 23 | StrongFontSmoothing = 3, |
| 24 | }; |
epoger@google.com | 7bc13a6 | 2012-02-14 14:53:59 +0000 | [diff] [blame] | 25 | NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; |
| 26 | [defaults setInteger:MediumFontSmoothing forKey:@"AppleFontSmoothing"]; |
| 27 | |
| 28 | [pool release]; |
| 29 | } |