views:

66

answers:

2

I've got an MFC application that is built with VC6. When ClearType is enabled (Windows XP) some texts are rendered smoothly, i.e. with ClearType, and others are not.

Dialog texts don't seem to ever get rendered with ClearType. Some list controls, however, have it enabled completely, others only in their headers.

What could be the reason for this? Where should I look to find out why it works only in some places and doesn't in others?

Update
As requested, here is an enlarged screenshot. Obfuscated but the important parts should be visible.

  • In List 1 only the heading is smooth, the content is not.
  • In List 2 both, heading and list items are smooth.
  • The Dialog at the bottom is not using ClearType either.
A: 

Bitmap fonts will never use ClearType. Usually you won't use a bitmap font, but I believe the default selected into a DC is the System font, which is bitmap.

Mark Ransom
Bitmap fonts are luckily not used.
mxp
A: 

ClearType is a quality property for fonts. You should get the LOGFONT for your CFont and set the lfQuality property. Here's an example.

CFont *pFont = CFont::FromHandle((HFONT)GetStockObject(DEFAULT_GUI_FONT));
LOGFONT logFont;
pFont->GetLogFont(&logFont);
logFont.lfQuality = CLEARTYPE_NATURAL_QUALITY;

CFont font2;
font2.CreateFontIndirect(&logFont);

Note: you can use either CLEARTYPE_QUALITY or CLEARTYPE_NATURAL_QUALITY, test both to see which looks best.

djeidot