The image or picture that you associate with each character or symbol in a font is called a glyph. The mapping between a set of glyphs and their code points is called a code page.

For a single byte character set (SBCS), each code page contains up to 256 code points. Normally these are 8-bit integers in the range 0 through 255, with one code point identifying one glyph in that code page. The code pages can be either ASCII or EBCDIC. Because a code point repeats on a new code page, you need both the code page and code point to uniquely identify a glyph.

There usually is one code page per font. However, double byte character sets (DBCS) are sometimes used for Asian languages with large character sets. Fonts are a set of glyph definitions and a default code page mapping. The same set of font glyph definitions is remapped for different code pages.

Each font contains four special glyph points:

First and last glyph points are of more interest to the font designers than application programmers because they apply to the set of font glyph definitions rather than a particular code page. The last character is the maximum code point of the font that has a glyph associated with it and may be bigger than 256.

The default glyph appears in text when an application specifies a glyph point that does not exist in the font.

The break glyph usually is the space character and often has the same code point as the default character.

Actually a font can have more or less than 256 definitions, but any particular code page may have less than 256 but no more. There may be a translation between the code point in the code page and the code point (between the first and last glyphs) that references the glyph in the font.

The operating system assigns unique identifiers to each of its code pages. Common code pages are 437-the United States code page, and 850-the multilingual code page. The default code page is 850.

An application can determine the current code page by calling GpiQueryCp. or it can assign a new code page using GpiSetCp. If you default the code page in the FATTRS structure when calling GpiCreateLogFont, you get the current code page as specified by GpiSetCp (or returned by GpiQueryCp). You can specify any one of the code page identifiers returned to you from WinQueryCpList.

When using a font other than the system font, you specify the required code page in the FATTRS structure of GpiCreateLogFont. You can determine the code page for that font (if it is the current logical font) by using GpiQueryFontMetrics.


[Back] [Next]