Welcome, guest | Sign In | My Account | Store | Cart

Running the script without parameters will enable Clear Type font smoothing. Pass 0, false, off, or disable to turn off Clear Type.

This version requires the pywin32 module from http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/

For a ctypes-based version see: http://code.activestate.com/recipes/578500-enable-clear-type-font-smoothing-on-windows-ctypes/

Python, 14 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# install pywin32 from http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/
import win32con
import win32gui
import sys

new_state = True

if len(sys.argv) > 1:
    new_state = sys.argv[1].lower() not in ['0', 'false', 'off', 'disable']

win32gui.SystemParametersInfo(win32con.SPI_SETFONTSMOOTHING, new_state, 0)
win32gui.SystemParametersInfo(win32con.SPI_SETFONTSMOOTHINGTYPE,
        win32con.FE_FONTSMOOTHINGCLEARTYPE,
        win32con.SPIF_UPDATEINIFILE | win32con.SPIF_SENDCHANGE)