Class: Fontisan::Stitcher::PartitionStrategy::Partition
- Inherits:
-
Struct
- Object
- Struct
- Fontisan::Stitcher::PartitionStrategy::Partition
- Defined in:
- lib/fontisan/stitcher/partition_strategy/partition.rb
Overview
One slice of a partitioned codepoint set. Each partition names a target subfont and the codepoints + donor mapping that should land in it.
#apply_to pushes the partition's bindings into a Stitcher via
include_codepoints_map (TODO 68). If that API is unavailable
(older Stitcher), it falls back to one include_codepoints
call per donor — but the preferred path is the map API.
Instance Attribute Summary collapse
-
#cps ⇒ Object
Returns the value of attribute cps.
-
#donor_map ⇒ Object
Returns the value of attribute donor_map.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#cps ⇒ Object
Returns the value of attribute cps
14 15 16 |
# File 'lib/fontisan/stitcher/partition_strategy/partition.rb', line 14 def cps @cps end |
#donor_map ⇒ Object
Returns the value of attribute donor_map
14 15 16 |
# File 'lib/fontisan/stitcher/partition_strategy/partition.rb', line 14 def donor_map @donor_map end |
#name ⇒ Object
Returns the value of attribute name
14 15 16 |
# File 'lib/fontisan/stitcher/partition_strategy/partition.rb', line 14 def name @name end |
Instance Method Details
#apply_to(stitcher) ⇒ void
This method returns an undefined value.
17 18 19 20 |
# File 'lib/fontisan/stitcher/partition_strategy/partition.rb', line 17 def apply_to(stitcher) slice = cps.to_h { |cp| [cp, donor_map[cp]] } stitcher.include_codepoints_map(slice, into: name) end |