--- w32term.c 25 Mar 2005 19:19:53 -0500 1.224 +++ w32term.c 03 Jun 2005 11:21:29 -0400 @@ -903,6 +903,29 @@ int real_width; GetCharWidth (hdc, *char2b, *char2b, &real_width); #endif + + BOOL smoothing_enabled; + UINT smoothing_type; + + /* Attempt to account for ClearType antialiasing. + * GetCharABCWidths fails to report the fractional pixels + * used for subpixel antialiasing + */ +#define W32_spi_getfontsmoothing 0x4A +#define W32_spi_getfontsmoothingtype 0x0200A +#define W32_fe_fontsmoothingcleartype 0x2 + + if (SystemParametersInfo(W32_spi_getfontsmoothing, 0, &smoothing_enabled, 0) + && smoothing_enabled + && SystemParametersInfo(W32_spi_getfontsmoothingtype, 0, &smoothing_type, 0) + && smoothing_type == W32_fe_fontsmoothingcleartype + ) + { + char_widths.abcA -=1; + char_widths.abcB +=2; + char_widths.abcC -= 1; + } + pcm->width = char_widths.abcA + char_widths.abcB + char_widths.abcC; #if 0 /* As far as I can tell, this is the best way to determine what