https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ffb4b674c7aba694d6657…
commit ffb4b674c7aba694d6657948fdc5f99a6ec2f474
Author: Maxim Smirnov <Maxim.like.python(a)ya.ru>
AuthorDate: Fri Apr 5 13:16:07 2019 +0300
Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Apr 7 01:42:29 2019 +0200
[FONT] Fix FontSmoothing
---
boot/bootdata/hivedef.inf | 2 +-
win32ss/gdi/ntgdi/freetype.c | 8 ++++++--
win32ss/user/ntuser/sysparams.c | 19 +++++++++++++------
3 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/boot/bootdata/hivedef.inf b/boot/bootdata/hivedef.inf
index d7e561f766..f03cbc532d 100644
--- a/boot/bootdata/hivedef.inf
+++ b/boot/bootdata/hivedef.inf
@@ -67,7 +67,7 @@ HKCU,"Control
Panel\Desktop","Pattern",2,"(None)"
HKCU,"Control Panel\Desktop","Wallpaper",0x00000002,""
HKCU,"Control Panel\Desktop","TileWallpaper",2,"0"
HKCU,"Control Panel\Desktop","WallpaperStyle",2,"2"
-HKCU,"Control Panel\Desktop","FontSmoothing",2,"1"
+HKCU,"Control Panel\Desktop","FontSmoothing",2,"0"
HKCU,"Control
Panel\Desktop","FontSmoothingOrientation",0x00010003,0x00000001
HKCU,"Control
Panel\Desktop","FontSmoothingType",0x00010003,0x00000001
HKCU,"Control
Panel\Desktop","ForegroundFlashCount",0x00010003,0x00000003
diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c
index 7e5307a716..a5f93e92c8 100644
--- a/win32ss/gdi/ntgdi/freetype.c
+++ b/win32ss/gdi/ntgdi/freetype.c
@@ -1661,8 +1661,12 @@ IntGetFontRenderMode(LOGFONTW *logfont)
return FT_RENDER_MODE_MONO;
case DRAFT_QUALITY:
return FT_RENDER_MODE_LIGHT;
- /* case CLEARTYPE_QUALITY:
- return FT_RENDER_MODE_LCD; */
+ case CLEARTYPE_QUALITY:
+ if (!gspv.bFontSmoothing)
+ break;
+ if (!gspv.uiFontSmoothingType)
+ break;
+ return FT_RENDER_MODE_LCD;
}
return FT_RENDER_MODE_NORMAL;
}
diff --git a/win32ss/user/ntuser/sysparams.c b/win32ss/user/ntuser/sysparams.c
index 0fede4ceec..a325dcc672 100644
--- a/win32ss/user/ntuser/sysparams.c
+++ b/win32ss/user/ntuser/sysparams.c
@@ -65,7 +65,10 @@ static const WCHAR* VAL_GRID = L"GridGranularity";
static const WCHAR* VAL_DRAG = L"DragFullWindows";
static const WCHAR* VAL_DRAGHEIGHT = L"DragHeight";
static const WCHAR* VAL_DRAGWIDTH = L"DragWidth";
-static const WCHAR* VAL_FNTSMOOTH = L"FontSmoothing";
+static const WCHAR* VAL_FONTSMOOTHING = L"FontSmoothing";
+static const WCHAR* VAL_FONTSMOOTHINGTYPE = L"FontSmoothingType";
+static const WCHAR* VAL_FONTSMOOTHINGCONTRAST = L"FontSmoothingGamma";
+static const WCHAR* VAL_FONTSMOOTHINGORIENTATION =
L"FontSmoothingOrientation";
static const WCHAR* VAL_SCRLLLINES = L"WheelScrollLines";
static const WCHAR* VAL_CLICKLOCKTIME = L"ClickLockTime";
static const WCHAR* VAL_PAINTDESKVER = L"PaintDesktopVersion";
@@ -284,6 +287,10 @@ SpiUpdatePerUserSystemParameters(VOID)
gspv.dwUserPrefMask = SpiLoadUserPrefMask(UPM_DEFAULT);
gspv.bMouseClickLock = (gspv.dwUserPrefMask & UPM_CLICKLOCK) != 0;
gspv.bMouseCursorShadow = (gspv.dwUserPrefMask & UPM_CURSORSHADOW) != 0;
+ gspv.bFontSmoothing = SpiLoadInt(KEY_DESKTOP, VAL_FONTSMOOTHING, 0) == 2;
+ gspv.uiFontSmoothingType = SpiLoadDWord(KEY_DESKTOP, VAL_FONTSMOOTHINGTYPE, 1);
+ gspv.uiFontSmoothingContrast = SpiLoadDWord(KEY_DESKTOP, VAL_FONTSMOOTHINGCONTRAST,
1400);
+ gspv.uiFontSmoothingOrientation = SpiLoadDWord(KEY_DESKTOP,
VAL_FONTSMOOTHINGORIENTATION, 1);
#if (_WIN32_WINNT >= 0x0600)
gspv.uiWheelScrollChars = SpiLoadInt(KEY_DESKTOP, VAL_SCRLLCHARS, 3);
#endif
@@ -1369,10 +1376,10 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
return SpiGetInt(pvParam, &gspv.bFontSmoothing, fl);
case SPI_SETFONTSMOOTHING:
- gspv.bFontSmoothing = uiParam ? TRUE : FALSE;
+ gspv.bFontSmoothing = (uiParam == 2);
if (fl & SPIF_UPDATEINIFILE)
{
- SpiStoreSzInt(KEY_DESKTOP, VAL_FNTSMOOTH, uiParam ? 2 : 0);
+ SpiStoreSz(KEY_DESKTOP, VAL_FONTSMOOTHING, (uiParam == 2) ?
L"2" : L"0");
}
return (UINT_PTR)KEY_DESKTOP;
@@ -1721,13 +1728,13 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
return SpiGetInt(pvParam, &gspv.uiFontSmoothingType, fl);
case SPI_SETFONTSMOOTHINGTYPE:
- return SpiSetInt(&gspv.uiFontSmoothingType, uiParam, KEY_MOUSE,
L"", fl);
+ return SpiSetDWord(&gspv.uiFontSmoothingType, PtrToUlong(pvParam),
KEY_DESKTOP, VAL_FONTSMOOTHINGTYPE, fl);
case SPI_GETFONTSMOOTHINGCONTRAST:
return SpiGetInt(pvParam, &gspv.uiFontSmoothingContrast, fl);
case SPI_SETFONTSMOOTHINGCONTRAST:
- return SpiSetInt(&gspv.uiFontSmoothingContrast, uiParam, KEY_MOUSE,
L"", fl);
+ return SpiSetDWord(&gspv.uiFontSmoothingContrast, PtrToUlong(pvParam),
KEY_DESKTOP, VAL_FONTSMOOTHINGCONTRAST, fl);
case SPI_GETFOCUSBORDERWIDTH:
return SpiGetInt(pvParam, &gspv.uiFocusBorderWidth, fl);
@@ -1745,7 +1752,7 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
return SpiGetInt(pvParam, &gspv.uiFontSmoothingOrientation, fl);
case SPI_SETFONTSMOOTHINGORIENTATION:
- return SpiSetInt(&gspv.uiFontSmoothingOrientation, uiParam, KEY_MOUSE,
L"", fl);
+ return SpiSetDWord(&gspv.uiFontSmoothingOrientation, PtrToUlong(pvParam),
KEY_DESKTOP, VAL_FONTSMOOTHINGORIENTATION, fl);
/* The following are undocumented, but valid SPI values */
case 0x1010: