class HexaPDF:: Font:: Encoding:: Base
| Parent | Object |
|---|
Base for encoding classes that are used for mapping codes in the range of 0 to 255 to glyph names.
Attributes
The hash mapping codes to names.
The name of the encoding or nil if the encoding has not been assigned a name.
Public Class Methods
Creates a new encoding object containing no default mappings.
Public Instance Methods
Returns the code for the given glyph name (a Symbol) or nil if there is no code for the given glyph name.
If multiple codes reference the given glyph name, the first found is always returned.
Returns the name for the given code, or .notdef if no glyph for the code is defined.
The returned value is always a Symbol object!
Returns the encoding in a compact array form.
If the optional base_encoding argument is specified, all codes that have the same value in the base encoding are ignored.
The returned array is of the form:
code1 name1 name2 ... code2 name3 name4 ...This means that name1 is associated with code1, name2 with code1 + 1 and so on.
See: PDF 2.0 s9.6.5.1
Returns the Unicode value in UTF-8 for the given code, or nil if the code cannot be mapped.
Note that this method caches the result of the Unicode mapping and therefore should only be called after all codes have been defined.