AFP fonts

A font is a collection of characters of a certain size, typeface, and type style. Advanced Function Presentation (AFP) fonts, also called Font Object Content Architecture (FOCA) fonts, are the standard fonts used for Intelligent Printer Data Stream (IPDS) output. AFP fonts are made up of a code page and a character set. All AFP fonts are encoded as either single-byte or double-byte fonts, depending on the language for which they are being used.

Each character in a font is identified by a 1-byte (single-byte) or a 2-byte (double-byte) code. The internal structure of fonts depends on whether the font is for a phonetic or a non-phonetic writing system. An example of a phonetic writing system is English. An example of a non-phonetic writing system is Kanji.

At least two resources are needed to make up a font: a font character set and a code page. The relationship between code pages and font character sets is illustrated in Figure 1. A third resource, a coded font, can define a font by naming a font character set and a code page.

Font character set
This resource contains the patterns for each character in the font and associates an 8-byte character identifier with each pattern. This resource also contains descriptive information for the entire character set.
Code page
This resource associates code points with character identifiers within a font character set, each representing a character pattern. A code point is an 8-bit binary number representing one of 256 potential characters.
Coded font
This resource associates one or more code pages with the appropriate font character sets.
Figure 1. Translation of a keyboard character into a printed character. A code page and character set together make a coded font. Pressing the A key selects Code point C1. The code page associates Code point C1 with Character ID LA020000. The character set associates Character ID LA020000 with an A in the selected typeface. An A prints on the page.
Pressing the A key causes the letter A to print.