Class: TTFunk::Table::Head

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

Instance Attribute Summary collapse

Attributes inherited from TTFunk::Table

#file, #length, #offset

Class Method Summary collapse

Methods inherited from TTFunk::Table

#exists?, #initialize, #raw, #tag

Constructor Details

This class inherits a constructor from TTFunk::Table

Instance Attribute Details

#checksum_adjustmentObject (readonly)

Returns the value of attribute checksum_adjustment.



8
9
10
# File 'lib/ttfunk/table/head.rb', line 8

def checksum_adjustment
  @checksum_adjustment
end

#createdObject (readonly)

Returns the value of attribute created.



12
13
14
# File 'lib/ttfunk/table/head.rb', line 12

def created
  @created
end

#flagsObject (readonly)

Returns the value of attribute flags.



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

def flags
  @flags
end

#font_direction_hintObject (readonly)

Returns the value of attribute font_direction_hint.



20
21
22
# File 'lib/ttfunk/table/head.rb', line 20

def font_direction_hint
  @font_direction_hint
end

#font_revisionObject (readonly)

Returns the value of attribute font_revision.



7
8
9
# File 'lib/ttfunk/table/head.rb', line 7

def font_revision
  @font_revision
end

#glyph_data_formatObject (readonly)

Returns the value of attribute glyph_data_format.



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

def glyph_data_format
  @glyph_data_format
end

#index_to_loc_formatObject (readonly)

Returns the value of attribute index_to_loc_format.



21
22
23
# File 'lib/ttfunk/table/head.rb', line 21

def index_to_loc_format
  @index_to_loc_format
end

#lowest_rec_ppemObject (readonly)

Returns the value of attribute lowest_rec_ppem.



19
20
21
# File 'lib/ttfunk/table/head.rb', line 19

def lowest_rec_ppem
  @lowest_rec_ppem
end

#mac_styleObject (readonly)

Returns the value of attribute mac_style.



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

def mac_style
  @mac_style
end

#magic_numberObject (readonly)

Returns the value of attribute magic_number.



9
10
11
# File 'lib/ttfunk/table/head.rb', line 9

def magic_number
  @magic_number
end

#modifiedObject (readonly)

Returns the value of attribute modified.



13
14
15
# File 'lib/ttfunk/table/head.rb', line 13

def modified
  @modified
end

#units_per_emObject (readonly)

Returns the value of attribute units_per_em.



11
12
13
# File 'lib/ttfunk/table/head.rb', line 11

def units_per_em
  @units_per_em
end

#versionObject (readonly)

Returns the value of attribute version.



6
7
8
# File 'lib/ttfunk/table/head.rb', line 6

def version
  @version
end

#x_maxObject (readonly)

Returns the value of attribute x_max.



16
17
18
# File 'lib/ttfunk/table/head.rb', line 16

def x_max
  @x_max
end

#x_minObject (readonly)

Returns the value of attribute x_min.



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

def x_min
  @x_min
end

#y_maxObject (readonly)

Returns the value of attribute y_max.



17
18
19
# File 'lib/ttfunk/table/head.rb', line 17

def y_max
  @y_max
end

#y_minObject (readonly)

Returns the value of attribute y_min.



15
16
17
# File 'lib/ttfunk/table/head.rb', line 15

def y_min
  @y_min
end

Class Method Details

.encode(head, loca) ⇒ Object



24
25
26
27
28
29
# File 'lib/ttfunk/table/head.rb', line 24

def self.encode(head, loca)
  table = head.raw
  table[8,4] = "\0\0\0\0" # set checksum adjustment to 0 initially
  table[-4,2] = [loca[:type]].pack("n") # set index_to_loc_format
  return table
end