Class: Postscript::Model::Operators::Font::Setfont

Inherits:
Postscript::Model::Operator show all
Defined in:
lib/postscript/model/operators/font.rb

Overview

Installs the font dictionary as the current font.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Postscript::Model::Operator

#accept, #operator?, register_as

Constructor Details

#initialize(font:) ⇒ Setfont

Returns a new instance of Setfont.



46
47
48
49
# File 'lib/postscript/model/operators/font.rb', line 46

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

Instance Attribute Details

#fontObject (readonly)

Returns the value of attribute font.



45
46
47
# File 'lib/postscript/model/operators/font.rb', line 45

def font
  @font
end

Class Method Details

.from_operands(stack) ⇒ Object



50
51
52
# File 'lib/postscript/model/operators/font.rb', line 50

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