Class: TTFunk::Table::Cff::Header

Inherits:
SubTable
  • Object
show all
Defined in:
lib/ttfunk/table/cff/header.rb

Overview

CFF Header.

Instance Attribute Summary collapse

Attributes inherited from SubTable

#file, #table_offset

Instance Method Summary collapse

Methods inherited from SubTable

#eot?, #initialize, #read

Constructor Details

This class inherits a constructor from TTFunk::SubTable

Instance Attribute Details

#absolute_offset_sizeInteger (readonly)

Size of all offsets from beginning of table.

Returns:

  • (Integer)


22
23
24
# File 'lib/ttfunk/table/cff/header.rb', line 22

def absolute_offset_size
  @absolute_offset_size
end

#header_sizeInteger (readonly)

Size of the header itself.

Returns:

  • (Integer)


18
19
20
# File 'lib/ttfunk/table/cff/header.rb', line 18

def header_size
  @header_size
end

#majorInteger (readonly)

CFF table major version.

Returns:

  • (Integer)


10
11
12
# File 'lib/ttfunk/table/cff/header.rb', line 10

def major
  @major
end

#minorInteger (readonly)

CFF table minor version.

Returns:

  • (Integer)


14
15
16
# File 'lib/ttfunk/table/cff/header.rb', line 14

def minor
  @minor
end

Instance Method Details

#encodeString

Encode header.

Returns:

  • (String)


34
35
36
# File 'lib/ttfunk/table/cff/header.rb', line 34

def encode
  [major, minor, header_size, absolute_offset_size].pack('C*')
end

#lengthInteger

Length of header.

Returns:

  • (Integer)


27
28
29
# File 'lib/ttfunk/table/cff/header.rb', line 27

def length
  4
end