Reguler & True type

There are two types of fonts. Reguler fonts and true type fonts. Regular fonts comes with .FON extensiton while true type fonts have .TTF or .TTC (true type collection) extension. True type fonts have additional drawing enhancements like antialiaing and clear type drawing. These font enhancement settings are available in control panel and these are user configurable. Enhancements can be seen in default quality if is is selected in font setup.

Quality parameter

The output quality depends on values of the parameter fdwQuality. The output quality defines how carefully GDI must attempt to match the logical-font attributes to those of an actual physical font. It can be one of the following values.

HFONT CreateFont(
  int     nHeight,
  int     nWidth,
  int     nEscapement,
  int     nOrientation,
  int     fnWeight,
  DWORD   fdwItalic,
  DWORD   fdwUnderline,
  DWORD   fdwStrikeOut,
  DWORD   fdwCharSet,
  DWORD   fdwOutputPrecision,
  DWORD   fdwClipPrecision,
  DWORD   fdwQuality,
  DWORD   fdwPitchAndFamily,
  LPCTSTR lpszFace

Quality options

ANTIALIASED_QUALITYFont is antialiased, or smoothed, if the font supports it and the size of the font is not too small or too large.
CLEARTYPE_QUALITYIf set, text is rendered (when possible) using ClearType antialiasing method. See Remarks for more information.
DEFAULT_QUALITYAppearance of the font does not matter.
DRAFT_QUALITYAppearance of the font is less important than when the PROOF_QUALITY value is used. For GDI raster fonts, scaling is enabled, which means that more font sizes are available, but the quality may be lower. Bold, italic, underline, and strikeout fonts are synthesized, if necessary.
NONANTIALIASED_QUALITYFont is never antialiased, that is, font smoothing is not done.
PROOF_QUALITYCharacter quality of the font is more important than exact matching of the logical-font attributes. For GDI raster fonts, scaling is disabled and the font closest in size is chosen. Although the chosen font size may not be mapped exactly when PROOF_QUALITY is used, the quality of the font is high and there is no distortion of appearance. Bold, italic, underline, and strikeout fonts are synthesized, if necessary.

If the output quality is DEFAULT_QUALITY, DRAFT_QUALITY, or PROOF_QUALITY, then the font is antialiased if the SPI_GETFONTSMOOTHING system parameter is TRUE. Users can control this system parameter from the Control Panel. (The precise wording of the setting in the Control panel depends on the version of Windows, but it will be words to the effect of "Smooth edges of screen fonts".)

About our authors: Team EQA

Further readings

Where is WinMain() function in MFC application ?

MFC hides WinMain in its framework and includes source file on WinMain(). This explains how framework calls global CWinApp::Initinstance() from entry WinMain.

What is the utility of CWinApp class?

This is constructed during global C++ objects are constructed and is already available when Windows calls the WinMain function, which is supplied by the ...

Basic steps in Win32 GUI Application with source code.

Define a custom Window class structure, Register the class name, CreateWindow, Show windows and write message get and dispatch loop statements. Define the Window CallBack procedure and write the handlers.

What is a Window CallBack procedure and what is its utility?

DispatchMessage() is a API which indirectly triggers the Window CallBack procedure. Message structure members from this function are passed to the CallBack procedure. CallBack procedure should implement event handlers depending on the need of the application.

What are LPARAM and WPARAM in window proc function?

LPARAM and WPARAM are the two parameters in Window CallBack procedure. They signifies parameters of various events. They are used in handing individual events.

What are the basic steps of a typical MFC based application?

We need to write WinMain and need to follow all these in a Win32 application. However we need not to write much if we are writing an application with MFC ...