Class: TTFunk::Table::Dsig

Inherits:
TTFunk::Table show all
Defined in:
lib/ttfunk/table/dsig.rb

Overview

Digital Signature (‘DSIG`) table.

Defined Under Namespace

Classes: SignatureRecord

Constant Summary collapse

TAG =

Table tag.

'DSIG'

Instance Attribute Summary collapse

Attributes inherited from TTFunk::Table

#file, #length, #offset

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TTFunk::Table

#exists?, #initialize, #raw

Constructor Details

This class inherits a constructor from TTFunk::Table

Instance Attribute Details

#flagsInteger (readonly)

Permission flags.

Returns:

  • (Integer)


43
44
45
# File 'lib/ttfunk/table/dsig.rb', line 43

def flags
  @flags
end

#signaturesArray<SignatureRecord> (readonly)

Signature records.

Returns:



47
48
49
# File 'lib/ttfunk/table/dsig.rb', line 47

def signatures
  @signatures
end

#versionInteger (readonly)

Version umber of this table.

Returns:

  • (Integer)


39
40
41
# File 'lib/ttfunk/table/dsig.rb', line 39

def version
  @version
end

Class Method Details

.encode(dsig) ⇒ String

Encode table.

Note: all signatures will be lost. This encodes an empty table regardless whether the supplied table contains any signtaures or not.

Parameters:

Returns:

  • (String)


59
60
61
62
63
64
65
# File 'lib/ttfunk/table/dsig.rb', line 59

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

Instance Method Details

#tagString

Table tag.

Returns:

  • (String)


70
71
72
# File 'lib/ttfunk/table/dsig.rb', line 70

def tag
  TAG
end