Permalink
Browse files

Allow in-memory fonts to be parsed

  • Loading branch information...
1 parent c7e5072 commit 5d04018493e004646a5ae885d7ff4d4dfc8524ea @jamis jamis committed Jan 2, 2009
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/ttfunk.rb
View
@@ -6,8 +6,12 @@ class File
attr_reader :contents
attr_reader :directory
- def initialize(file)
- @contents = StringIO.new(IO.read(file))
+ def self.open(file)
+ new(IO.read(file))
+ end
+
+ def initialize(contents)
+ @contents = StringIO.new(contents)
@directory = Directory.new(@contents)
end

0 comments on commit 5d04018

Please sign in to comment.