ui: only set font quality if ClearType is enabled (fixes #216, closes #311, closes #327)

This commit is contained in:
Andreas Jönsson 2015-06-25 19:20:42 +02:00 committed by Damien GERARD
parent a9ed6b436b
commit 759fc1b0f3

View File

@ -296,8 +296,20 @@ LRESULT Notepad_plus::init(HWND hwnd)
_mainEditView.execute(SCI_SETCARETLINEVISIBLE, svp1._currentLineHilitingShow);
_subEditView.execute(SCI_SETCARETLINEVISIBLE, svp1._currentLineHilitingShow);
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);