Class: TTFunk::Table::Sbix

### Home Classes Methods

### In Files

- lib/ttfunk/table/sbix.rb

### Parent

TTFunk::Table

### Methods

- #all_bitmap_data_for
- #bitmap_data_for

### 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::Format06
- TTFunk::Table::Cmap::Format10
- TTFunk::Table::Cmap::Format12
- 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::Format30
- TTFunk::Table::Post::Format40
- TTFunk::Table::Sbix
- TTFunk::Table::Simple

No matching classes.

# TTFunk::Table::Sbix

### Constants

BitmapData

### Attributes

flags[R]
num_strikes[R]
strikes[R]
version[R]

### Public Instance Methods

all_bitmap_data_for(glyph_id) click to toggle source

    # File lib/ttfunk/table/sbix.rb, line 32
    def all_bitmap_data_for(glyph_id)
      strikes.each_index.map do |strike_index|
        bitmap_data_for(glyph_id, strike_index)
      end.compact
    end

bitmap_data_for(glyph_id, strike_index) click to toggle source

    # File lib/ttfunk/table/sbix.rb, line 13
    def bitmap_data_for(glyph_id, strike_index)
      strike = strikes[strike_index]
      return if strike.nil?

      glyph_offset = strike[:glyph_data_offset][glyph_id]
      next_glyph_offset = strike[:glyph_data_offset][glyph_id + 1]

      if glyph_offset && next_glyph_offset
        bytes = next_glyph_offset - glyph_offset
        if bytes > 0
          parse_from(offset + strike[:offset] + glyph_offset) do
            x, y, type = read(8, "s2A4")
            data = StringIO.new(io.read(bytes - 8))
            BitmapData.new(x, y, type, data, strike[:ppem], strike[:resolution])
          end
        end
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.