Class: Dvi::Opcode::FntNum
Overview
FunNum is a class for fnt_num_0 … fnt_num_63 opcodes.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
Returns the value of attribute index.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(index) ⇒ FntNum
constructor
A new instance of FntNum.
-
#interpret(ps) ⇒ Object
Changes the current processor’s font.
Methods inherited from Base
Constructor Details
#initialize(index) ⇒ FntNum
Returns a new instance of FntNum.
331 332 333 334 |
# File 'lib/dvi/opcode.rb', line 331 def initialize(index) raise ArgumentError unless 0 <= index && index <= 63 @index = index end |
Instance Attribute Details
#index ⇒ Object (readonly)
Returns the value of attribute index.
329 330 331 |
# File 'lib/dvi/opcode.rb', line 329 def index @index end |
Class Method Details
.read(cmd, io) ⇒ Object
336 337 338 |
# File 'lib/dvi/opcode.rb', line 336 def self.read(cmd, io) return self.new(cmd - 171) end |
Instance Method Details
#interpret(ps) ⇒ Object
Changes the current processor’s font. The font should be defined by fnt_def1 .. fnt_def4.
342 343 344 345 |
# File 'lib/dvi/opcode.rb', line 342 def interpret(ps) raise Error unless ps.fonts.has_key?(@index) ps.font = ps.fonts[@index] end |