Class: Fontisan::Ufo::Groups
- Inherits:
-
Object
- Object
- Fontisan::Ufo::Groups
- Defined in:
- lib/fontisan/ufo/groups.rb
Overview
Group definitions parsed from groups.plist. Maps a group name
to a list of glyph names belonging to that group:
{ "MMK_L_A" => ["A", "Agrave", "Aacute", ...],
"MMK_R_T" => ["T", "Tcommaaccent", ...] }
Group pair keys in kerning.plist (e.g. "MMK_L_A MMK_R_T")
reference these names — kern writer + GPOS builder resolve them
to glyph sets before emitting PairPos records.
Instance Attribute Summary collapse
-
#groups ⇒ Object
readonly
Returns the value of attribute groups.
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#glyphs(name) ⇒ Object
Glyph names belonging to
name. -
#include?(name) ⇒ Boolean
Whether
nameis a known group. -
#initialize(values = {}) ⇒ Groups
constructor
A new instance of Groups.
-
#names ⇒ Object
All group names.
- #to_plist ⇒ Object
Constructor Details
#initialize(values = {}) ⇒ Groups
Returns a new instance of Groups.
17 18 19 |
# File 'lib/fontisan/ufo/groups.rb', line 17 def initialize(values = {}) @groups = values end |
Instance Attribute Details
#groups ⇒ Object (readonly)
Returns the value of attribute groups.
15 16 17 |
# File 'lib/fontisan/ufo/groups.rb', line 15 def groups @groups end |
Instance Method Details
#empty? ⇒ Boolean
36 37 38 |
# File 'lib/fontisan/ufo/groups.rb', line 36 def empty? @groups.empty? end |
#glyphs(name) ⇒ Object
Glyph names belonging to name. Empty array if unknown.
27 28 29 |
# File 'lib/fontisan/ufo/groups.rb', line 27 def glyphs(name) @groups[name] || [] end |
#include?(name) ⇒ Boolean
Whether name is a known group.
32 33 34 |
# File 'lib/fontisan/ufo/groups.rb', line 32 def include?(name) @groups.key?(name) end |
#names ⇒ Object
All group names.
22 23 24 |
# File 'lib/fontisan/ufo/groups.rb', line 22 def names @groups.keys end |
#to_plist ⇒ Object
40 41 42 |
# File 'lib/fontisan/ufo/groups.rb', line 40 def to_plist @groups end |