Print Page | Close Window

How to disable font smoothing

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=23083
Printed Date: 05 May 2024 at 4:36am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to disable font smoothing
Posted By: SvenC
Subject: How to disable font smoothing
Date 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



Replies:
Posted By: SvenC
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net