Tom 7 embed as ruby C extension
require 'tembed'
# override files
Tembed.call! '/path/to/font.ttf'
Tembed.call! File.new('/path/to/font.ttf')
Tembed.call! Pathname('/path/to/font.ttf')
# yield fixed data, but don't override file
Tembed.call('/path/to/font.ttf') do |data|
# write fixed data
end
Tembed.call(IO.read('/path/to/font.ttf')) do |data|
# write fixed data
end
$ rake compile; irb -r ./lib/tembed
gem build tembed.gemspec