Module: Fontisan::Stitcher::Selector

Defined in:
lib/fontisan/stitcher/selector.rb,
lib/fontisan/stitcher/selector/gid.rb,
lib/fontisan/stitcher/selector/range.rb,
lib/fontisan/stitcher/selector/codepoints.rb

Overview

Selectors decide which glyphs from a source to include in the stitched font. Each selector appends to the Stitcher's bindings list. OCP: adding a new way to select = adding a new Selector class + a registry entry.

Defined Under Namespace

Classes: Codepoints, Gid, Range

Constant Summary collapse

REGISTRY =
{
  range: Range,
  codepoints: Codepoints,
  gid: Gid,
}.freeze

Class Method Summary collapse

Class Method Details

.resolve(name) ⇒ Object



20
21
22
23
# File 'lib/fontisan/stitcher/selector.rb', line 20

def self.resolve(name)
  REGISTRY[name.to_sym] or
    raise ArgumentError, "unknown selector: #{name.inspect}"
end