Class: HexaPDF::Font::Encoding::DifferenceEncoding

Inherits:
Base
  • Object
show all
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

Attributes inherited from Base

#code_to_name, #encoding_name

Instance Method Summary collapse

Methods inherited from Base

#unicode

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_encodingObject (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