Class: Fontisan::Ufo::Kerning
- Inherits:
-
Object
- Object
- Fontisan::Ufo::Kerning
- Defined in:
- lib/fontisan/ufo/kerning.rb
Overview
A Kerning pairs table parsed from kerning.plist. Pairs are
stored as "<left> <right>" => float, matching the file format.
Group pair keys ("<left_group> <right_group>") are stored verbatim.
Instance Attribute Summary collapse
-
#pairs ⇒ Object
readonly
Returns the value of attribute pairs.
Instance Method Summary collapse
- #[](pair_key) ⇒ Object
- #[]=(pair_key, value) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(values = {}) ⇒ Kerning
constructor
A new instance of Kerning.
- #to_plist ⇒ Object
Constructor Details
#initialize(values = {}) ⇒ Kerning
Returns a new instance of Kerning.
11 12 13 |
# File 'lib/fontisan/ufo/kerning.rb', line 11 def initialize(values = {}) @pairs = values end |
Instance Attribute Details
#pairs ⇒ Object (readonly)
Returns the value of attribute pairs.
9 10 11 |
# File 'lib/fontisan/ufo/kerning.rb', line 9 def pairs @pairs end |
Instance Method Details
#[](pair_key) ⇒ Object
15 16 17 |
# File 'lib/fontisan/ufo/kerning.rb', line 15 def [](pair_key) @pairs[pair_key.to_s] end |
#[]=(pair_key, value) ⇒ Object
19 20 21 |
# File 'lib/fontisan/ufo/kerning.rb', line 19 def []=(pair_key, value) @pairs[pair_key.to_s] = value end |
#empty? ⇒ Boolean
23 24 25 |
# File 'lib/fontisan/ufo/kerning.rb', line 23 def empty? @pairs.empty? end |
#to_plist ⇒ Object
27 28 29 |
# File 'lib/fontisan/ufo/kerning.rb', line 27 def to_plist @pairs end |