Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - How to disable font smoothing
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to disable font smoothing

 Post Reply Post Reply
Author
Message
SvenC View Drop Down
Groupie
Groupie


Joined: 02 February 2007
Status: Offline
Points: 79
Post Options Post Options   Thanks (0) Thanks(0)   Quote SvenC Quote  Post ReplyReply Direct Link To This Post Topic: How to disable font smoothing
    Posted: 02 August 2016 at 3:15am
I would like to control font smoothing / anti-aliasing of the text in the toolkit controls.

Preferred would be that the system setting for font smoothing (Advanced System Settings > Performance Settings > "Smooth edged of screen fonts") would be used so that standard controls like window menus and Toolkit controls use the same way to display font.

How can I control text anti aliasing?
--
SvenC

Toolkit Pro 15.3.1, 16.2.4, 16.3.1, 16.4.0, 17.2.0, 17.3.0, 18.0.1, 18.2 with VC++ 2010, 2012, 2013, 2015, 2017
Back to Top
SvenC View Drop Down
Groupie
Groupie


Joined: 02 February 2007
Status: Offline
Points: 79
Post Options Post Options   Thanks (0) Thanks(0)   Quote SvenC Quote  Post ReplyReply Direct Link To This Post Posted: 02 August 2016 at 3:55am
Found it by digging through the code:

In my paint manager impl I get the current LOGFONT, set its lfQuality member and apply that font.

    if(m_fontCaption.GetLogFont(&lf))
    {
      lf.lfQuality = NONANTIALIASED_QUALITY;
      SetCaptionFont(lf);
      SetTextFont(lf);
    }

Would be nice if the draw helper class could use some global state and not IsClearTypeTextQualitySupported to control this:

BOOL CXTPDrawHelpers::GetIconLogFont(LOGFONT* pLogFont)
{
ASSERT(pLogFont);
if (!pLogFont)
return FALSE;

::ZeroMemory(pLogFont, sizeof(LOGFONT));

if (::SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), pLogFont, 0))
{
if (XTPSystemVersion()->IsClearTypeTextQualitySupported())
pLogFont->lfQuality = CLEARTYPE_QUALITY;

pLogFont->lfCharSet = XTPResourceManager()->GetFontCharset();

return TRUE;
}

return FALSE;
}

--
SvenC

Toolkit Pro 15.3.1, 16.2.4, 16.3.1, 16.4.0, 17.2.0, 17.3.0, 18.0.1, 18.2 with VC++ 2010, 2012, 2013, 2015, 2017
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.140 seconds.