Parent

Methods

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.