2.13 Font Functions

Font functions select, create, remove, and retrieve information about fonts.
A font is a subset of a particular typeface, which is a set of characters that
share a similar fundamental design.

The following list briefly describes each font function:

Function Description  
AddFontResource Adds a font resource in the specified file to the system font table.  
CreateFont Creates a logical font that has the specified characteristics.  
CreateFontIndirect Creates a logical font that has the specified characteristics.  
EnumFonts Enumerates the fonts available on a given device.  
GetCharWidth Retrieves the widths of individual characters.  
RemoveFontResource Removes a font resource from the font table.  
SetMapperFlags Alters the algorithm the font mapper uses.  

A font family is a group of typefaces that have similar stroke-width and serif characteristics. A typeface is a set of characters (letters, numerals, punctuation marks, symbols) that share a common design. Font characters share very specific characteristics, such as point size and weight.

Note that the terms GDI uses to describe fonts, typefaces, and families of fonts do not necessarily correspond to traditional typographic terms.

The HelveticaÒ typeface is an example of a familiar typeface. It belongs to the SwissÔ font family. Available fonts within this typeface include 8-point Helvetica bold and 10-point Helvetica italic.

Figure 2.9 shows several fonts from the Helvetica and Courier typefaces: