class TTFunk::Table::Hhea

Attributes

advance_width_max[R]
ascent[R]
carot_slope_rise[R]
carot_slope_run[R]
descent[R]
line_gap[R]
metric_data_format[R]
min_left_side_bearing[R]
min_right_side_bearing[R]
number_of_metrics[R]
version[R]
x_max_extent[R]

Public Class Methods

encode(hhea, hmtx) click to toggle source
# File lib/ttfunk/table/hhea.rb, line 19
def self.encode(hhea, hmtx)
  raw = hhea.raw
  raw[-2, 2] = [hmtx[:number_of_metrics]].pack('n')
  raw
end

Private Instance Methods

parse!() click to toggle source
# File lib/ttfunk/table/hhea.rb, line 27
def parse!
  @version = read(4, 'N').first
  @ascent, @descent, @line_gap = read_signed(3)
  @advance_width_max = read(2, 'n').first

  @min_left_side_bearing, @min_right_side_bearing, @x_max_extent,
    @carot_slope_rise, @carot_slope_run, @caret_offset,
    _reserved, _reserved, _reserved, _reserved,
    @metric_data_format = read_signed(11)

  @number_of_metrics = read(2, 'n').first
end