blob: 1c43b749b17aad3c831c5a8b60889713cf6f22a8 [file] [log] [blame]
epoger@google.com7bc13a62012-02-14 14:53:59 +00001/*
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.com13130862012-06-06 12:10:45 +000010// FIXME: should be in a header
11void setSystemPreferences();
12
epoger@google.com7bc13a62012-02-14 14:53:59 +000013void 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.com13130862012-06-06 12:10:45 +000019 enum {
20 NoFontSmoothing = 0,
21 LightFontSmoothing = 1,
22 MediumFontSmoothing = 2,
23 StrongFontSmoothing = 3,
24 };
epoger@google.com7bc13a62012-02-14 14:53:59 +000025 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
26 [defaults setInteger:MediumFontSmoothing forKey:@"AppleFontSmoothing"];
27
28 [pool release];
29}