public interface CharSet
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.
Modifier and Type | Interface and Description |
---|---|
static class |
CharSet.Predefined
Enumeration of predefined character sets.
|
Modifier and Type | Method and Description |
---|---|
int |
getIndex(int codePoint)
Returns the array index for a Unicode code point in this character set.
|
int |
size()
Returns the number of elements (Unicode code points) in this character set.
|
int getIndex(int codePoint)
codePoint
- The Unicode code point whose index should be found.codePoint
, or -1 if it is not in the character set.int size()
This documentation was created 2017-01-24 at 21:26 GMT by The aXSL Group and may be freely copied. See license for details.