Class: Postsvg::Model::Operators::Font::Scalefont
- Inherits:
-
Postsvg::Model::Operator
- Object
- Postsvg::Model::Operator
- Postsvg::Model::Operators::Font::Scalefont
- Defined in:
- lib/postsvg/model/operators/font.rb
Overview
Returns a new font dictionary scaled to the given size.
Instance Attribute Summary collapse
-
#font ⇒ Object
readonly
Returns the value of attribute font.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(font:, size:) ⇒ Scalefont
constructor
A new instance of Scalefont.
Methods inherited from Postsvg::Model::Operator
#accept, #operator?, register_as
Constructor Details
#initialize(font:, size:) ⇒ Scalefont
Returns a new instance of Scalefont.
30 31 32 33 34 |
# File 'lib/postsvg/model/operators/font.rb', line 30 def initialize(font:, size:) @font = font @size = size freeze end |
Instance Attribute Details
#font ⇒ Object (readonly)
Returns the value of attribute font.
29 30 31 |
# File 'lib/postsvg/model/operators/font.rb', line 29 def font @font end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
29 30 31 |
# File 'lib/postsvg/model/operators/font.rb', line 29 def size @size end |
Class Method Details
.from_operands(stack) ⇒ Object
35 36 37 38 39 |
# File 'lib/postsvg/model/operators/font.rb', line 35 def self.from_operands(stack) size = stack.pop_number font = stack.pop new(font: font, size: size) end |