aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/system_preferences_mac.mm
blob: 1c43b749b17aad3c831c5a8b60889713cf6f22a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * Copyright 2012 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#import <Cocoa/Cocoa.h>

// FIXME: should be in a header
void setSystemPreferences();

void setSystemPreferences() {
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

    // Set LCD font smoothing level for this application (does not affect other
    // applications). Based on resetDefaultsToConsistentValues() in
    // http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
    enum {
        NoFontSmoothing     = 0,
        LightFontSmoothing  = 1,
        MediumFontSmoothing = 2,
        StrongFontSmoothing = 3,
    };
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults setInteger:MediumFontSmoothing forKey:@"AppleFontSmoothing"];

    [pool release];
}