Class: Postsvg::Model::Operators::Font::Findfont

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

Overview

Pushes a font dictionary onto the stack by name. name is the PostScript font name (e.g. "Helvetica"). The visitor pushes a Font value object.

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(name:) ⇒ Findfont

Returns a new instance of Findfont.



17
18
19
20
# File 'lib/postsvg/model/operators/font.rb', line 17

def initialize(name:)
  @name = name
  freeze
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



16
17
18
# File 'lib/postsvg/model/operators/font.rb', line 16

def name
  @name
end

Class Method Details

.from_operands(stack) ⇒ Object



21
22
23
# File 'lib/postsvg/model/operators/font.rb', line 21

def self.from_operands(stack)
  new(name: stack.pop)
end