Class: TTFunk::Table

### Home Classes Methods

### In Files

- lib/ttfunk/table/cmap/subtable.rb
- lib/ttfunk/table/cmap/format00.rb
- lib/ttfunk/table/cmap/format04.rb
- lib/ttfunk/table/post.rb
- lib/ttfunk/table/loca.rb
- lib/ttfunk/table/post/format40.rb
- lib/ttfunk/table/post/format20.rb
- lib/ttfunk/table/post/format10.rb
- lib/ttfunk/table/post/format30.rb
- lib/ttfunk/table/post/format25.rb
- lib/ttfunk/table/cmap.rb
- lib/ttfunk/table/os2.rb
- lib/ttfunk/table/glyf/compound.rb
- lib/ttfunk/table/glyf/simple.rb
- lib/ttfunk/table/hhea.rb
- lib/ttfunk/table/maxp.rb
- lib/ttfunk/table/kern.rb
- lib/ttfunk/table/glyf.rb
- lib/ttfunk/table/head.rb
- lib/ttfunk/table/simple.rb
- lib/ttfunk/table/hmtx.rb
- lib/ttfunk/table/kern/format0.rb
- lib/ttfunk/table/name.rb
- lib/ttfunk/table.rb

### Parent

Object

### Namespace

- CLASS TTFunk::Table::Cmap
- CLASS TTFunk::Table::Glyf
- CLASS TTFunk::Table::Head
- CLASS TTFunk::Table::Hhea
- CLASS TTFunk::Table::Hmtx
- CLASS TTFunk::Table::Kern
- CLASS TTFunk::Table::Loca
- CLASS TTFunk::Table::Maxp
- CLASS TTFunk::Table::Name
- CLASS TTFunk::Table::OS2
- CLASS TTFunk::Table::Post
- CLASS TTFunk::Table::Simple

### Methods

- ::new
- #exists?
- #raw
- #tag

### Included Modules

- TTFunk::Reader

### Class/Module Index

Quicksearch

- TTFunk
- TTFunk::Directory
- TTFunk::Encoding
- TTFunk::Encoding::MacRoman
- TTFunk::Encoding::Windows1252
- TTFunk::File
- TTFunk::Reader
- TTFunk::ResourceFile
- TTFunk::Subset
- TTFunk::Subset::Base
- TTFunk::Subset::MacRoman
- TTFunk::Subset::Unicode
- TTFunk::Subset::Unicode8Bit
- TTFunk::Subset::Windows1252
- TTFunk::SubsetCollection
- TTFunk::Table
- TTFunk::Table::Cmap
- TTFunk::Table::Cmap::Format00
- TTFunk::Table::Cmap::Format04
- TTFunk::Table::Cmap::Subtable
- TTFunk::Table::Glyf
- TTFunk::Table::Glyf::Compound
- TTFunk::Table::Glyf::Simple
- TTFunk::Table::Head
- TTFunk::Table::Hhea
- TTFunk::Table::Hmtx
- TTFunk::Table::Kern
- TTFunk::Table::Kern::Format0
- TTFunk::Table::Loca
- TTFunk::Table::Maxp
- TTFunk::Table::Name
- TTFunk::Table::Name::String
- TTFunk::Table::OS2
- TTFunk::Table::Post
- TTFunk::Table::Post::Format10
- TTFunk::Table::Post::Format20
- TTFunk::Table::Post::Format25
- TTFunk::Table::Post::Format30
- TTFunk::Table::Post::Format40
- TTFunk::Table::Simple

No matching classes.

# TTFunk::Table

### Attributes

file[R]
length[R]
offset[R]

### Public Class Methods

new(file) click to toggle source

    # File lib/ttfunk/table.rb, line 11
    def initialize(file)
      @file = file

      info = file.directory_info(tag)

      if info
        @offset = info[:offset]
        @length = info[:length]

        parse_from(@offset) { parse! }
      end
    end

### Public Instance Methods

exists?() click to toggle source

    # File lib/ttfunk/table.rb, line 24
    def exists?
      !@offset.nil?
    end

raw() click to toggle source

    # File lib/ttfunk/table.rb, line 28
    def raw
      if exists?
        parse_from(offset) { io.read(length) }
      else
        nil
      end
    end

tag() click to toggle source

    # File lib/ttfunk/table.rb, line 36
    def tag
      self.class.name.split(/::/).last.downcase
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.