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 | |
tfarina@chromium.org | 7b3b26e | 2012-09-26 15:41:42 +0000 | [diff] [blame] | 8 | #include "system_preferences.h" |
epoger@google.com | 7bc13a6 | 2012-02-14 14:53:59 +0000 | [diff] [blame] | 9 | |
tfarina@chromium.org | 7b3b26e | 2012-09-26 15:41:42 +0000 | [diff] [blame] | 10 | #import <Cocoa/Cocoa.h> |
caryclark@google.com | 1313086 | 2012-06-06 12:10:45 +0000 | [diff] [blame] | 11 | |
epoger@google.com | 7bc13a6 | 2012-02-14 14:53:59 +0000 | [diff] [blame] | 12 | void setSystemPreferences() { |
| 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; |
| 14 | |
| 15 | // Set LCD font smoothing level for this application (does not affect other |
| 16 | // applications). Based on resetDefaultsToConsistentValues() in |
| 17 | // http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm |
caryclark@google.com | 1313086 | 2012-06-06 12:10:45 +0000 | [diff] [blame] | 18 | enum { |
| 19 | NoFontSmoothing = 0, |
| 20 | LightFontSmoothing = 1, |
| 21 | MediumFontSmoothing = 2, |
| 22 | StrongFontSmoothing = 3, |
| 23 | }; |
epoger@google.com | 7bc13a6 | 2012-02-14 14:53:59 +0000 | [diff] [blame] | 24 | NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; |
| 25 | [defaults setInteger:MediumFontSmoothing forKey:@"AppleFontSmoothing"]; |
| 26 | |
| 27 | [pool release]; |
| 28 | } |