diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 1bdb89bc..c5a9ad05 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -296,8 +296,20 @@ LRESULT Notepad_plus::init(HWND hwnd) _mainEditView.execute(SCI_SETCARETLINEVISIBLE, svp1._currentLineHilitingShow); _subEditView.execute(SCI_SETCARETLINEVISIBLE, svp1._currentLineHilitingShow); - _mainEditView.execute(SCI_SETFONTQUALITY, SC_EFF_QUALITY_LCD_OPTIMIZED); - _subEditView.execute(SCI_SETFONTQUALITY, SC_EFF_QUALITY_LCD_OPTIMIZED); + UINT smoothingType = 0; + if (0 != ::SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &smoothingType, 0)) + { + if (FE_FONTSMOOTHINGCLEARTYPE == smoothingType) + { + _mainEditView.execute(SCI_SETFONTQUALITY, SC_EFF_QUALITY_LCD_OPTIMIZED); + _subEditView.execute(SCI_SETFONTQUALITY, SC_EFF_QUALITY_LCD_OPTIMIZED); + } + } + else + { + // Fail silently - font smoothing is not important enough to do anything else. + assert(false and "failed to retrieve system info 'SPI_GETFONTSMOOTHINGTYPE'"); + } _mainEditView.execute(SCI_SETCARETLINEVISIBLEALWAYS, true); _subEditView.execute(SCI_SETCARETLINEVISIBLEALWAYS, true);