Class: Tipo::Header
- Inherits:
-
Object
- Object
- Tipo::Header
- Defined in:
- lib/tipo/header.rb
Defined Under Namespace
Classes: OffsetTable, TableRecord
Instance Attribute Summary collapse
-
#font ⇒ Object
readonly
Returns the value of attribute font.
Instance Method Summary collapse
-
#initialize(font) ⇒ Header
constructor
A new instance of Header.
- #offset_table ⇒ Object
- #table_records ⇒ Object
Constructor Details
#initialize(font) ⇒ Header
Returns a new instance of Header.
11 12 13 |
# File 'lib/tipo/header.rb', line 11 def initialize font @font = font end |
Instance Attribute Details
#font ⇒ Object (readonly)
Returns the value of attribute font.
9 10 11 |
# File 'lib/tipo/header.rb', line 9 def font @font end |
Instance Method Details
#offset_table ⇒ Object
15 16 17 |
# File 'lib/tipo/header.rb', line 15 def offset_table OffsetTable.new *(font.unpack seek: 0, bytes: 12, tmpl: 'a4n') end |
#table_records ⇒ Object
19 20 21 22 23 24 |
# File 'lib/tipo/header.rb', line 19 def table_records font.seek 13 offset_table.tables_count.times.map do TableRecord.new *(font.unpack bytes: 16, tmpl: 'a4N2') end end |