class TTFunk::Table::Head

Attributes

checksum_adjustment[R]
created[R]
flags[R]
font_direction_hint[R]
font_revision[R]
glyph_data_format[R]
index_to_loc_format[R]
lowest_rec_ppem[R]
mac_style[R]
magic_number[R]
modified[R]
units_per_em[R]
version[R]
x_max[R]
x_min[R]
y_max[R]
y_min[R]

Public Class Methods

encode(head, loca) click to toggle source
# 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
  table
end

Private Instance Methods

parse!() click to toggle source
# File lib/ttfunk/table/head.rb, line 33
def parse!
  @version, @font_revision, @check_sum_adjustment, @magic_number,
    @flags, @units_per_em, @created, @modified = read(36, 'N4n2q2')

  @x_min, @y_min, @x_max, @y_max = read_signed(4)

  @mac_style, @lowest_rec_ppem, @font_direction_hint,
    @index_to_loc_format, @glyph_data_format = read(10, 'n*')
end