Class: Tipo::Table::Substitution
- Inherits:
-
Base
- Object
- Base
- Tipo::Table::Substitution
show all
- Defined in:
- lib/tipo/table/substitution.rb
Defined Under Namespace
Classes: FeatureRecord, Header
Instance Attribute Summary
Attributes inherited from Base
#font, #font_header, #name
Instance Method Summary
collapse
Methods inherited from Base
#offset
Constructor Details
#initialize(header, font) ⇒ Substitution
Returns a new instance of Substitution.
16
17
18
19
|
# File 'lib/tipo/table/substitution.rb', line 16
def initialize , font
@name = "GSUB"
super
end
|
Instance Method Details
#feature_list ⇒ Object
33
34
35
36
37
|
# File 'lib/tipo/table/substitution.rb', line 33
def feature_list
feature_list_count.times.map do
FeatureRecord.new *(font.unpack bytes: 6, tmpl: 'a4n')
end
end
|
#feature_list_count ⇒ Object
29
30
31
|
# File 'lib/tipo/table/substitution.rb', line 29
def feature_list_count
font.unpack(seek: feature_list_offset, bytes: 2, tmpl: 'n').first
end
|
#feature_list_offset ⇒ Object
25
26
27
|
# File 'lib/tipo/table/substitution.rb', line 25
def feature_list_offset
.feature_offset + offset
end
|
21
22
23
|
# File 'lib/tipo/table/substitution.rb', line 21
def
Header.new *(font.unpack seek: offset, bytes: 10, tmpl: 'n5')
end
|