Class: TTFunk::Directory
- Inherits:
-
Object
- Object
- TTFunk::Directory
- Defined in:
- lib/ttfunk/directory.rb
Instance Attribute Summary (collapse)
-
- (Object) scaler_type
readonly
Returns the value of attribute scaler_type.
-
- (Object) tables
readonly
Returns the value of attribute tables.
Instance Method Summary (collapse)
-
- (Directory) initialize(io)
constructor
A new instance of Directory.
Constructor Details
- (Directory) initialize(io)
A new instance of Directory
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/ttfunk/directory.rb', line 6 def initialize(io) @scaler_type, table_count, search_range, entry_selector, range_shift = 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
- (Object) scaler_type (readonly)
Returns the value of attribute scaler_type
4 5 6 |
# File 'lib/ttfunk/directory.rb', line 4 def scaler_type @scaler_type end |
- (Object) tables (readonly)
Returns the value of attribute tables
3 4 5 |
# File 'lib/ttfunk/directory.rb', line 3 def tables @tables end |