class TTFunk::Table

SFNT table

def exists?

Returns:
  • (Boolean) -
def exists?
  !@offset.nil?
end

def initialize(file)

Parameters:
  • file (TTFunk::File) --
def initialize(file)
  @file = file
  @offset = nil
  @length = nil
  info = file.directory_info(tag)
  if info
    @offset = info[:offset]
    @length = info[:length]
    parse_from(@offset) { parse! }
  end
end

def parse!

def parse!
  # do nothing, by default
end

def raw

Returns:
  • (String, nil) -
def raw
  if exists?
    parse_from(offset) { io.read(length) }
  end
end

def tag

Returns:
  • (String) -
def tag
  self.class.name.split('::').last.downcase
end