Class: HexaPDF::Font::Encoding::DifferenceEncoding
- Defined in:
- lib/hexapdf/font/encoding/difference_encoding.rb
Overview
The difference encoding uses a base encoding that can be overlayed with additional mappings.
See: PDF1.7 s9.6.6.1
Instance Attribute Summary collapse
-
#base_encoding ⇒ Object
readonly
The base encoding.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(base_encoding) ⇒ DifferenceEncoding
constructor
Initializes the Differences object with the given base encoding object.
-
#name(code) ⇒ Object
Returns the name for the given code, either from this object, if it contains the code, or from the base encoding.
Methods inherited from Base
Constructor Details
#initialize(base_encoding) ⇒ DifferenceEncoding
Initializes the Differences object with the given base encoding object.
49 50 51 52 |
# File 'lib/hexapdf/font/encoding/difference_encoding.rb', line 49 def initialize(base_encoding) super() @base_encoding = base_encoding end |
Instance Attribute Details
#base_encoding ⇒ Object (readonly)
The base encoding.
46 47 48 |
# File 'lib/hexapdf/font/encoding/difference_encoding.rb', line 46 def base_encoding @base_encoding end |
Instance Method Details
#name(code) ⇒ Object
Returns the name for the given code, either from this object, if it contains the code, or from the base encoding.
56 57 58 |
# File 'lib/hexapdf/font/encoding/difference_encoding.rb', line 56 def name(code) code_to_name[code] || base_encoding.name(code) end |