class HexaPDF::Font::TrueType::Table::Hmtx

See: developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6hmtx.html<br><br>of each glyph in the font.
The ‘hmtx’ (horizontal metrics) table contains information for the horizontal layout

def [](glyph_id)

Returns the Metric object for the give glyph ID.
def [](glyph_id)
  @horizontal_metrics[glyph_id]
end

def parse_table #:nodoc:

:nodoc:
def parse_table #:nodoc:
  nr_entries = font[:hhea].num_of_long_hor_metrics
  max_id = nr_entries + (directory_entry.length - 4 * nr_entries) / 2
  @horizontal_metrics = Hash.new do |hash, glyph_id|
    return nil if glyph_id >= max_id
    if glyph_id >= nr_entries
      with_io_pos(directory_entry.offset + 4 * nr_entries + (glyph_id - nr_entries) * 2) do
        hash[glyph_id] = Metric.new(@horizontal_metrics[nr_entries - 1].advance_width,
                                    *read_formatted(2, 's>'))
      end
    else
      with_io_pos(directory_entry.offset + 4 * glyph_id) do
        hash[glyph_id] = Metric.new(*read_formatted(4, 'ns>'))
      end
    end
    hash[glyph_id]
  end
end