A CharSet is a collection of related characters. Fonts are frequently designed to cover a specific collection of characters. For example, 12 of the Base-14 fonts cover the ExtendedRoman collection.
The main purpose of the CharSet interface is to efficiently map a Unicode code point to an array index that can be used in some other place to store information about that code point. For example, as an Adobe Font Metrics (AFM) file is parsed, width metric information is accumulated about each glyph in the font. Those widths are most efficiently stored in an array, but some means for getting the index to that array is needed. The font Encoding is not a suitable concept to use as an index for such information, because it is limited to 256 characters and, as a matter of practice, most Encodings use less than that. A font may contain more than 256 glyphs. For example, the ExtendedRoman character set contains 315 glyphs. By separating CharSet from Encoding, we can record all of the information about a font without caring how it will be encoded as it is used.
|
|
|
|