Class: Fontisan::Ufo::Groups

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#groupsObject (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

Returns:

  • (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.

Returns:

  • (Boolean)


32
33
34
# File 'lib/fontisan/ufo/groups.rb', line 32

def include?(name)
  @groups.key?(name)
end

#namesObject

All group names.



22
23
24
# File 'lib/fontisan/ufo/groups.rb', line 22

def names
  @groups.keys
end

#to_plistObject



40
41
42
# File 'lib/fontisan/ufo/groups.rb', line 40

def to_plist
  @groups
end