Class: HexaPDF::Font::TrueType::Table::Kern::Subtable
- Inherits:
-
Object
- Object
- HexaPDF::Font::TrueType::Table::Kern::Subtable
- Defined in:
- lib/hexapdf/font/true_type/table/kern.rb
Overview
A kerning subtable containing the actual information to do kerning.
Instance Method Summary collapse
-
#cross_stream? ⇒ Boolean
Returns
true
if this subtable contains cross-stream values, i.e. -
#horizontal? ⇒ Boolean
Returns
true
if this subtable is used for horizontal kerning. -
#initialize(pairs:, horizontal:, minimum_values:, cross_stream:) ⇒ Subtable
constructor
Creates a new subtable.
-
#kern(left, right) ⇒ Object
Returns the kerning value between the two glyphs, or
nil
if there is no kerning value. -
#minimum_values? ⇒ Boolean
Returns
true
if this subtable contains minimum values and not kerning values.
Constructor Details
#initialize(pairs:, horizontal:, minimum_values:, cross_stream:) ⇒ Subtable
Creates a new subtable.
57 58 59 60 61 62 |
# File 'lib/hexapdf/font/true_type/table/kern.rb', line 57 def initialize(pairs:, horizontal:, minimum_values:, cross_stream:) @pairs = pairs @horizontal = horizontal @minimum_values = minimum_values @cross_stream = cross_stream end |
Instance Method Details
#cross_stream? ⇒ Boolean
Returns true
if this subtable contains cross-stream values, i.e. values that are applied perpendicular to the writing direction.
82 83 84 |
# File 'lib/hexapdf/font/true_type/table/kern.rb', line 82 def cross_stream? @cross_stream end |
#horizontal? ⇒ Boolean
Returns true
if this subtable is used for horizontal kerning.
71 72 73 |
# File 'lib/hexapdf/font/true_type/table/kern.rb', line 71 def horizontal? @horizontal end |
#kern(left, right) ⇒ Object
Returns the kerning value between the two glyphs, or nil
if there is no kerning value.
66 67 68 |
# File 'lib/hexapdf/font/true_type/table/kern.rb', line 66 def kern(left, right) @pairs.fetch(left, nil)&.fetch(right, nil) end |
#minimum_values? ⇒ Boolean
Returns true
if this subtable contains minimum values and not kerning values.
76 77 78 |
# File 'lib/hexapdf/font/true_type/table/kern.rb', line 76 def minimum_values? @minimum_values end |