Skip to content

ClearType Investigations

bp2008 edited this page Nov 7, 2019 · 5 revisions

For the development of this application, I needed to analyze the inner workings (hah, "workings") of the ClearType Tuner that is built in to Windows (Win10 1903). It is a real mess. Here are details of my findings.

Bore me with the details

The ClearType tuner built in to Windows has many pages, each controlling one or more registry keys. Many of the registry keys have no apparent effect on Windows' text rendering. Probably they once did work, but not anymore.

In the following sections, I describe the effects each control appeared to have on the Windows Registry.

Turn on ClearType

First, you are given a checkbox "Turn on ClearType". If you disable ClearType, none of the other settings appear to affect text rendering (until you turn ClearType back on).

When ClearType is enabled, you get RGB or BGR subpixel antialiasing:
HKEY_CURRENT_USER\Control Panel\Desktop > FontSmoothingType -> 2

When ClearType is disabled, you get grayscale antialiasing:
HKEY_CURRENT_USER\Control Panel\Desktop > FontSmoothingType -> 1

(1/5) RGB or BGR subpixel antialiasing

Two options are shown.

The left option uses RGB subpixel antialiasing, suitable for LCD computer monitors with an RGB subpixel layout (which is most of them).

The right option is for BGR subpixel antialiasing. Television panels often use a BGR subpixel layout.

If you choose the wrong type of antialiasing here, you may notice increased red and blue color fringing on the sides of text.

  • 1st Option (RGB subpixel antialiasing)

    • HKEY_CURRENT_USER\Control Panel\Desktop > FontSmoothingOrientation -> 1
    • HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics\DISPLAY1 > PixelStructure -> 1
    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Avalon.Graphics\DISPLAY1 > PixelStructure -> 1
  • 2nd Option (BGR subpixel antialiasing)

    • HKEY_CURRENT_USER\Control Panel\Desktop > FontSmoothingOrientation -> 0
    • HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics\DISPLAY1 > PixelStructure -> 2
    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Avalon.Graphics\DISPLAY1 > PixelStructure -> 2

(2/5) Gamma

Here, you control the contrast (lightness/darkness) of text by changing the value of this registry key:

HKEY_CURRENT_USER\Control Panel\Desktop > FontSmoothingGamma

This page is wacky. There are 6 buttons in total, but 7 possible values. The default button is whatever value you had set before you started the ClearType tuner. The 7 values this page can set for FontSmoothingGamma are 1000, 1200, 1400, 1600, 1800, 2000, 2200. One extreme (1000 or 2200) will be unavailable depending on what value was set when you started.

1000 is the darkest, and 2200 is the lightest.

This page also appears to set two additional registry values, but it appears to always set a value of 2200 and this registry key appears to have no effect anyway.

  • HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics\DISPLAY1 > GammaLevel -> 2200
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Avalon.Graphics\DISPLAY1 > GammaLevel -> 2200

(3/5) ClearType Level (APPARENTLY NON-FUNCTIONAL)

It seems the intent of this page was to control the intensity of the colors used in subpixel antialiasing.

  • Left Option (strong color edges for antialiasing)
    • HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics\DISPLAY1 > ClearTypeLevel -> 100
  • Middle Option (medium color edges for antialiasing)
    • HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics\DISPLAY1 > ClearTypeLevel -> 50
  • Right Option (grayscale edges for antialiasing)
    • HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics\DISPLAY1 > ClearTypeLevel -> 0

(4/5) EnhancedContrastLevel (APPARENTLY NON-FUNCTIONAL)

This page is another contrast control, intended to affect lightness of text when using color subpixel antialiasing.

It controls the value of the registry key:
HKEY_CURRENT_USER\Control Panel\Desktop > EnhancedContrastLevel

The 6 possible values from left to right, top to bottom, are 0, 50, 100, 200, 300, 400. The default value is 50.

(5/5) GrayscaleEnhancedContrastLevel (APPARENTLY NON-FUNCTIONAL)

This page is another contrast control, intended to affect lightness of text when using grayscale subpixel antialiasing.

It controls the value of the registry key:
HKEY_CURRENT_USER\Control Panel\Desktop > GrayscaleEnhancedContrastLevel

The 6 possible values from left to right, top to bottom, are 0, 50, 100, 200, 300, 400. The default value is 100.

TextContrastLevel

There is a registry key I didn't mention, called TextContrastLevel, accepting values 0 through 6 where larger values supposedly cause text to be rendered with a wider "stem". MS documentation says the default value is 1, but I only ever noticed it with a value of 0 or 2, and I am not quite sure what caused these to be set. I believe this is another obsolete registry key.

Turning off text antialiasing altogether

Based on this, you can toggle text antialiasing on and off by going to:

  • System Properties window (Windows key + Pause/Break)
  • Advanced System settings
  • Advanced tab
  • Performance > Settings
  • Uncheck the checkbox for Smooth edges of screen font
  • Apply/OK

Enabled: HKEY_CURRENT_USER\Control Panel\Desktop > FontSmoothing -> 2
Disabled: HKEY_CURRENT_USER\Control Panel\Desktop > FontSmoothing -> 0

Conclusions

There are three places where font rendering settings are located in the registry.

The actually-functional registry keys appear to be in HKEY_CURRENT_USER\Control Panel\Desktop.

Additional registry keys which had no apparent effect are here:

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics

Some of the keys from above are copied into:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Avalon.Graphics

As far as I know, the monitor-specific nature of these registry keys never mattered, and everything always just used the settings of the primary display. It is possible that some applications read from these older locations to determine font rendering settings.