Sha256: 49541ec1128876c002ca290e4e821d6a837a1ea4c003adcf50c08fda6b42cd49

Contents?: true

Size: 410 Bytes

Versions: 2

Compression:

Stored size: 410 Bytes

Contents

module TTFunk
  class Directory
    attr_reader :tables
    attr_reader :scaler_type

    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
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ttfunk-1.4.0 lib/ttfunk/directory.rb
ttfunk-1.3.0 lib/ttfunk/directory.rb