Class: TTFunk::Directory
- Inherits:
-
Object
- Object
- TTFunk::Directory
- Defined in:
- lib/ttfunk/directory.rb
Instance Attribute Summary collapse
-
#scaler_type ⇒ Object
readonly
Returns the value of attribute scaler_type.
-
#tables ⇒ Object
readonly
Returns the value of attribute tables.
Instance Method Summary collapse
-
#initialize(io) ⇒ Directory
constructor
A new instance of Directory.
Constructor Details
#initialize(io) ⇒ Directory
Returns a new instance of Directory.
6 7 8 9 10 11 12 13 14 |
# File 'lib/ttfunk/directory.rb', line 6 def initialize(io) @scaler_type, table_count = io.read(12).unpack("Nn") @tables = {} table_count.times do tag, checksum, offset, length = io.read(16).unpack("a4N*") @tables[tag] = { :tag => tag, :checksum => checksum, :offset => offset, :length => length } end end |
Instance Attribute Details
#scaler_type ⇒ Object (readonly)
Returns the value of attribute scaler_type.
4 5 6 |
# File 'lib/ttfunk/directory.rb', line 4 def scaler_type @scaler_type end |
#tables ⇒ Object (readonly)
Returns the value of attribute tables.
3 4 5 |
# File 'lib/ttfunk/directory.rb', line 3 def tables @tables end |