class TTFunk::Table::Dsig

Constants

TAG

Attributes

flags[R]
signatures[R]
version[R]

Public Class Methods

encode(dsig) click to toggle source
# File lib/ttfunk/table/dsig.rb, line 21
def self.encode(dsig)
  return unless dsig

  # Don't attempt to re-sign or anything - just use dummy values.
  # Since we're subsetting that should be permissible.
  [dsig.version, 0, 0].pack('Nnn')
end

Public Instance Methods

tag() click to toggle source
# File lib/ttfunk/table/dsig.rb, line 29
def tag
  TAG
end

Private Instance Methods

parse!() click to toggle source
# File lib/ttfunk/table/dsig.rb, line 35
def parse!
  @version, num_signatures, @flags = read(8, 'Nnn')

  @signatures =
    Array.new(num_signatures) do
      format, length, sig_offset = read(12, 'N3')
      signature =
        parse_from(offset + sig_offset) do
          _, _, sig_length = read(8, 'nnN')
          read(sig_length, 'C*')
        end

      SignatureRecord.new(format, length, sig_offset, signature)
    end
end