Class: Fontisan::Tables::Hmtx::LongHorMetric

Inherits:
Binary::BaseRecord show all
Defined in:
lib/fontisan/tables/hmtx.rb

Overview

LongHorMetric record structure

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Binary::BaseRecord

#raw_data, read, #valid?

Instance Attribute Details

#advance_widthInteger

Returns Advance width in FUnits.

Returns:

  • (Integer)

    Advance width in FUnits



49
50
51
52
53
54
55
56
57
58
59
# File 'lib/fontisan/tables/hmtx.rb', line 49

class LongHorMetric < Binary::BaseRecord
  uint16 :advance_width
  int16 :lsb

  # Convert to hash for convenience
  #
  # @return [Hash] Hash with :advance_width and :lsb keys
  def to_h
    { advance_width: advance_width, lsb: lsb }
  end
end

#lsbInteger

Returns Left side bearing in FUnits.

Returns:

  • (Integer)

    Left side bearing in FUnits



49
50
51
52
53
54
55
56
57
58
59
# File 'lib/fontisan/tables/hmtx.rb', line 49

class LongHorMetric < Binary::BaseRecord
  uint16 :advance_width
  int16 :lsb

  # Convert to hash for convenience
  #
  # @return [Hash] Hash with :advance_width and :lsb keys
  def to_h
    { advance_width: advance_width, lsb: lsb }
  end
end

Instance Method Details

#to_hHash

Convert to hash for convenience

Returns:

  • (Hash)

    Hash with :advance_width and :lsb keys



56
57
58
# File 'lib/fontisan/tables/hmtx.rb', line 56

def to_h
  { advance_width: advance_width, lsb: lsb }
end