class HexaPDF::Font::Encoding::Base

Parent

Base for encoding classes that are used for mapping codes in the range of 0 to 255 to glyph names.

Attributes

code_to_name[R]

The hash mapping codes to names.

encoding_name[R]

The name of the encoding or nil if the encoding has not been assigned a name.

Public Class Methods

new()

Creates a new encoding object containing no default mappings.

Public Instance Methods

name(code)

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!

unicode(code)

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.