Class: Postsvg::Model::Operators::Font::Charpath

Inherits:
Postsvg::Model::Operator show all
Defined in:
lib/postsvg/model/operators/font.rb

Overview

Appends glyph outlines for text to the current path (PLRM charpath).

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Postsvg::Model::Operator

#accept, #operator?, register_as

Constructor Details

#initialize(text:, stroke:) ⇒ Charpath

Returns a new instance of Charpath.



107
108
109
110
111
# File 'lib/postsvg/model/operators/font.rb', line 107

def initialize(text:, stroke:)
  @text = text
  @stroke = stroke
  freeze
end

Instance Attribute Details

#strokeObject (readonly)

Returns the value of attribute stroke.



106
107
108
# File 'lib/postsvg/model/operators/font.rb', line 106

def stroke
  @stroke
end

#textObject (readonly)

Returns the value of attribute text.



106
107
108
# File 'lib/postsvg/model/operators/font.rb', line 106

def text
  @text
end

Class Method Details

.from_operands(stack) ⇒ Object



112
113
114
115
116
# File 'lib/postsvg/model/operators/font.rb', line 112

def self.from_operands(stack)
  stroke = stack.pop
  text = stack.pop
  new(text: text, stroke: stroke)
end