Class: TTFunk::Table::Cmap

### Home Classes Methods

### In Files

- lib/ttfunk/table/cmap.rb
- lib/ttfunk/table/cmap/format00.rb
- lib/ttfunk/table/cmap/format04.rb
- lib/ttfunk/table/cmap/format06.rb
- lib/ttfunk/table/cmap/format10.rb
- lib/ttfunk/table/cmap/format12.rb
- lib/ttfunk/table/cmap/subtable.rb

### Parent

TTFunk::Table

### Namespace

- MODULE TTFunk::Table::Cmap::Format00
- MODULE TTFunk::Table::Cmap::Format04
- MODULE TTFunk::Table::Cmap::Format06
- MODULE TTFunk::Table::Cmap::Format10
- MODULE TTFunk::Table::Cmap::Format12
- CLASS TTFunk::Table::Cmap::Subtable

### Methods

- ::encode
- #unicode

### 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::Cmap

### Attributes

tables[R]
version[R]

### Public Class Methods

encode(charmap, encoding) click to toggle source

    # File lib/ttfunk/table/cmap.rb, line 7
    def self.encode(charmap, encoding)
      result = Cmap::Subtable.encode(charmap, encoding)

      # pack 'version' and 'table-count'
      result[:table] = [0, 1, result.delete(:subtable)].pack("nnA*")
      return result
    end

### Public Instance Methods

unicode() click to toggle source

    # File lib/ttfunk/table/cmap.rb, line 15
    def unicode
      # Because most callers just call .first on the result, put tables with
      # highest-number format first. Unsupported formats will be ignored.
      @unicode ||= @tables.select { |table| table.unicode? && table.supported? }
                          .sort{|a,b| b.format <=> a.format }
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.