Class: Tipo::Font
Instance Method Summary collapse
- #chunk(options) ⇒ Object
- #encoding ⇒ Object
-
#initialize(file) ⇒ Font
constructor
A new instance of Font.
- #unpack(options) ⇒ Object
Constructor Details
#initialize(file) ⇒ Font
Returns a new instance of Font.
9 10 11 |
# File 'lib/tipo/font.rb', line 9 def initialize file @file = File.open file, 'rb:ASCII-8BIT' end |
Instance Method Details
#chunk(options) ⇒ Object
17 18 19 20 |
# File 'lib/tipo/font.rb', line 17 def chunk @file.seek [:seek] if [:seek] @file.read .fetch :bytes end |
#encoding ⇒ Object
13 14 15 |
# File 'lib/tipo/font.rb', line 13 def encoding @file.read(5).encoding end |
#unpack(options) ⇒ Object
22 23 24 25 |
# File 'lib/tipo/font.rb', line 22 def unpack tmpl = .delete :tmpl chunk().unpack tmpl end |