Class: Tipo::Table::Naming
- Inherits:
-
Base
- Object
- Base
- Tipo::Table::Naming
show all
- Defined in:
- lib/tipo/table/naming.rb
Defined Under Namespace
Classes: Header, NameRecord
Instance Attribute Summary
Attributes inherited from Base
#font, #font_header
Instance Method Summary
collapse
Methods inherited from Base
#offset
Constructor Details
#initialize(header, font) ⇒ Naming
Returns a new instance of Naming.
11
12
13
14
|
# File 'lib/tipo/table/naming.rb', line 11
def initialize , font
@name = 'name'
super
end
|
Instance Method Details
#family_name ⇒ Object
36
37
38
|
# File 'lib/tipo/table/naming.rb', line 36
def family_name
stringify_record record_at 1
end
|
16
17
18
|
# File 'lib/tipo/table/naming.rb', line 16
def
Header.new *(font.unpack seek: offset, bytes: 6, tmpl: 'n3')
end
|
#name ⇒ Object
40
41
42
|
# File 'lib/tipo/table/naming.rb', line 40
def name
stringify_record record_at 4
end
|
#naming_list ⇒ Object
24
25
26
27
28
|
# File 'lib/tipo/table/naming.rb', line 24
def naming_list
.count.times.map do
NameRecord.new *(font.unpack bytes: 12, tmpl: 'n6')
end
end
|
#record_at(id) ⇒ Object
30
31
32
33
34
|
# File 'lib/tipo/table/naming.rb', line 30
def record_at id
naming_list.select do |n|
n.name == id && n.platform == 1
end.first
end
|
#storage_offset ⇒ Object
20
21
22
|
# File 'lib/tipo/table/naming.rb', line 20
def storage_offset
.storage_offset + offset
end
|
#style ⇒ Object
44
45
46
|
# File 'lib/tipo/table/naming.rb', line 44
def style
stringify_record record_at 2
end
|