MFC forcibly enables cleartype in afxGlobalData.fontRegular and others - by zeromus

Status : 

  By Design<br /><br />
		The product team believes this item works according to its intended design.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 780747 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 3/5/2013 7:45:17 PM
Access Restriction Public


MFC is forcibly enabling cleartype when segoe UI font is found.  This happens in afxglobals.cpp, where the following code is run

lf.lfQuality = 5 /*CLEARTYPE_QUALITY*/;

This is happening in the vs2010 MFC as well.

I would imagine this is being done because MFC must use the segoe UI font instead of the system default font.  I'm not clear on why MFC needs to be doing this. It is contributing to a ghetto chaos rotted appearance which makes windows software nowadays frequently resemble a 1997 linux desktop.  It makes MFC parts look wrong compared to other parts of apps which take pains to be respectful of the user's configuration.

Understandably, the segoe UI font was not designed to be used without cleartype. And that is why someone thought it was wise to add this code to force cleartype. But, anyone who has disabled cleartype would rather see ugly apps than cleartyped apps. I feel confident speaking for them.

Finally, I know MFC can be caused to use the system default font. I am not looking forward to asking every developer of MFC software to change his code in order to bypass MFC's font trickery. I would rather system libraries use the system default fonts as a default font.
Sign in to post a comment.
Posted by zeromus on 6/18/2015 at 10:28 PM
Some developers are not happy doing that, since they feel as if it is a dirty hack. Moreover it is not _my_ code I'm talking about here. It's 100% of users of MFC who have to correct this mistake in MFC. Actually getting them to do that is an impossible task.

Furthermore, given your explanation "we wanted to use segoe" (ok, fine, it's ugly but it's consistent) you haven't addressed the fact that MFC additionally enforces cleartype in contradiction of the user's system preferences.

Posted by zeromus on 3/12/2013 at 9:31 AM
OK. As a consequence of this, you're forcing users who have disabled cleartype to see cleartype. You should at least get the user's system font antialiasing preference and apply it correctly when creating the office 2007 font.
Posted by Microsoft on 3/11/2013 at 2:10 PM

Thanks for the report. We have investigated this and found that it is by design: we've used the same font as MS Office 2007 (for consistency), instead of the system font. If for some reason you need to use the system menu font instead, it's possible to override the behavior by setting this:

afxGlobals.m_bUseSystemFont = TRUE;

in your application class constructor.

Pat Brenner
Visual C++ Libraries Development
Posted by Macy [MSFT] on 3/7/2013 at 4:34 AM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Helen [MSFT] on 3/5/2013 at 7:51 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(