class HexaPDF::Font::TrueType::Table::Kern

The 'kern' table contains kerning values, i.e. values to control inter-character spacing.

Restrictions:

See: www.microsoft.com/typography/otspec/kern.htm

Attributes

subtables[R]

The available subtables, all instances of Subtable.

version[RW]

The version of the table.

Public Instance Methods

horizontal_kerning_subtable() click to toggle source

Returns the first subtable that supports horizontal non-cross-stream kerning, or nil if no such subtable exists.

# File lib/hexapdf/font/true_type/table/kern.rb, line 95
def horizontal_kerning_subtable
  @horizontal_kerning_subtable
end

Private Instance Methods

parse_subtable0(nr_of_subtables) { |length| ... } click to toggle source

Parses subtables for kern table version 0.

# File lib/hexapdf/font/true_type/table/kern.rb, line 127
def parse_subtable0(nr_of_subtables)
  nr_of_subtables.times do
    length, format, coverage = read_formatted(6, 'x2nCC')
    options = {horizontal: (coverage[0] == 1),
               minimum_values: (coverage[1] == 1),
               cross_stream: (coverage[2] == 1)}
    yield(length - 6, format, options)
  end
end
parse_subtable1(nr_of_subtables) { |length| ... } click to toggle source

Parses subtables for kern table version 1.

# File lib/hexapdf/font/true_type/table/kern.rb, line 138
def parse_subtable1(nr_of_subtables)
  nr_of_subtables.times do
    length, coverage, format = read_formatted(8, 'NCC')
    options = {horizontal: (coverage[7] == 0),
               minimum_values: false,
               cross_stream: (coverage[6] == 1)}
    yield(length - 8, format, options)
  end
end