def __init__(self, filename, debug=0, debugfile=sys.stdout): """ opens the dvi file and reads the preamble """ self.filename = filename self.debug = debug self.debugfile = debugfile self.debugstack = [] self.fonts = {} self.activefont = None # stack of fonts and fontscale currently used (used for VFs) self.fontstack = [] self.stack = [] # pointer to currently active page self.actpage = None # stack for self.file, self.fonts and self.stack, needed for VF inclusion self.statestack = [] self.file = reader.reader(self.filename) # currently read byte in file (for debugging output) self.filepos = None self._read_pre()