Skip to content

Commit

Permalink
ui: only set font quality if ClearType is enabled (fixes notepad-plus…
Browse files Browse the repository at this point in the history
  • Loading branch information
jonandr authored and Rikk committed Jul 4, 2015
1 parent 3b888bc commit 4a555a3
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions PowerEditor/src/Notepad_plus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4a555a3

Please sign in to comment.