Class: Dvi::Processor

Inherits:
Object
  • Object
show all
Defined in:
lib/dvi.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lsr = Dvi::LsR.default) ⇒ Processor

Returns a new instance of Processor.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/dvi.rb', line 8

def initialize(lsr=Dvi::LsR.default)
  @h = 0 # horizontal position
  @v = 0 # vertical position
  @w = 0 # 
  @x = 0
  @y = 0
  @z = 0
  @font = nil
  @stack = []
  @chars = []
  @rules = []
  @fonts = Hash.new
  @lsr = lsr
end

Instance Attribute Details

#charsObject (readonly)

Returns the value of attribute chars.



4
5
6
# File 'lib/dvi.rb', line 4

def chars
  @chars
end

#denominatorObject

Returns the value of attribute denominator.



5
6
7
# File 'lib/dvi.rb', line 5

def denominator
  @denominator
end

#dvi_versionObject

Returns the value of attribute dvi_version.



5
6
7
# File 'lib/dvi.rb', line 5

def dvi_version
  @dvi_version
end

#fontObject

Returns the value of attribute font.



3
4
5
# File 'lib/dvi.rb', line 3

def font
  @font
end

#fontsObject

Returns the value of attribute fonts.



3
4
5
# File 'lib/dvi.rb', line 3

def fonts
  @fonts
end

#hObject

Returns the value of attribute h.



3
4
5
# File 'lib/dvi.rb', line 3

def h
  @h
end

#lsrObject (readonly)

Returns the value of attribute lsr.



4
5
6
# File 'lib/dvi.rb', line 4

def lsr
  @lsr
end

#magObject

Returns the value of attribute mag.



5
6
7
# File 'lib/dvi.rb', line 5

def mag
  @mag
end

#numeratorObject

Returns the value of attribute numerator.



5
6
7
# File 'lib/dvi.rb', line 5

def numerator
  @numerator
end

#rulesObject (readonly)

Returns the value of attribute rules.



4
5
6
# File 'lib/dvi.rb', line 4

def rules
  @rules
end

#stackObject (readonly)

Returns the value of attribute stack.



4
5
6
# File 'lib/dvi.rb', line 4

def stack
  @stack
end

#total_pagesObject

Returns the value of attribute total_pages.



6
7
8
# File 'lib/dvi.rb', line 6

def total_pages
  @total_pages
end

#vObject

Returns the value of attribute v.



3
4
5
# File 'lib/dvi.rb', line 3

def v
  @v
end

#wObject

Returns the value of attribute w.



3
4
5
# File 'lib/dvi.rb', line 3

def w
  @w
end

#xObject

Returns the value of attribute x.



3
4
5
# File 'lib/dvi.rb', line 3

def x
  @x
end

#yObject

Returns the value of attribute y.



3
4
5
# File 'lib/dvi.rb', line 3

def y
  @y
end

#zObject

Returns the value of attribute z.



3
4
5
# File 'lib/dvi.rb', line 3

def z
  @z
end

Instance Method Details

#process(opcode) ⇒ Object



23
24
25
# File 'lib/dvi.rb', line 23

def process(opcode)
  opcode.interpret(self)
end