3.1.2.1. DviMachine

class PyDvi.Dvi.DviMachine.Opcode_set_char(char_code)[source]

Bases: PyDvi.Dvi.DviMachine.Opcode_putset_char

This class implements the set_char opcode.

class PyDvi.Dvi.DviMachine.Opcode_put_char(char_code)[source]

Bases: PyDvi.Dvi.DviMachine.Opcode_putset_char

This class implements the put_char opcode.

class PyDvi.Dvi.DviMachine.Opcode_set_rule(height, width)[source]

Bases: PyDvi.Dvi.DviMachine.Opcode_putset_rule

This class implements the set_rule opcode.

class PyDvi.Dvi.DviMachine.Opcode_put_rule(height, width)[source]

Bases: PyDvi.Dvi.DviMachine.Opcode_putset_rule

This class implements the put_rule opcode.

class PyDvi.Dvi.DviMachine.Opcode_push[source]

Bases: PyDvi.Dvi.DviMachine.Opcode

This class implements the push opcode.

run(dvi_machine, compute_bounding_box=False)[source]
class PyDvi.Dvi.DviMachine.Opcode_pop(n=1)[source]

Bases: PyDvi.Dvi.DviMachine.Opcode

This class implements the pop opcode.

run(dvi_machine, compute_bounding_box=False)[source]
class PyDvi.Dvi.DviMachine.Opcode_push_colour(colour)[source]

Bases: PyDvi.Dvi.DviMachine.Opcode

This class implements the push_colour opcode.

run(dvi_machine, compute_bounding_box=False)[source]
class PyDvi.Dvi.DviMachine.Opcode_pop_colour(n=1)[source]

Bases: PyDvi.Dvi.DviMachine.Opcode

This class implements the pop_colour opcode.

run(dvi_machine, compute_bounding_box=False)[source]
class PyDvi.Dvi.DviMachine.Opcode_right(x)[source]

Bases: PyDvi.Dvi.DviMachine.OpcodeX

This class implements the right opcode.

run(dvi_machine, compute_bounding_box=False)[source]
class PyDvi.Dvi.DviMachine.Opcode_w0[source]

Bases: PyDvi.Dvi.DviMachine.Opcode

This class implements the w0 opcode.

run(dvi_machine, compute_bounding_box=False)[source]
class PyDvi.Dvi.DviMachine.Opcode_w(x)[source]

Bases: PyDvi.Dvi.DviMachine.OpcodeX

This class implements the w opcode.

run(dvi_machine, compute_bounding_box=False)[source]
class PyDvi.Dvi.DviMachine.Opcode_x0[source]

Bases: PyDvi.Dvi.DviMachine.Opcode

This class implements the x0 opcode.

run(dvi_machine, compute_bounding_box=False)[source]
class PyDvi.Dvi.DviMachine.Opcode_x(x)[source]

Bases: PyDvi.Dvi.DviMachine.OpcodeX

This class implements the x opcode.

run(dvi_machine, compute_bounding_box=False)[source]
class PyDvi.Dvi.DviMachine.Opcode_down(x)[source]

Bases: PyDvi.Dvi.DviMachine.OpcodeX

This class implements the down opcode.

run(dvi_machine, compute_bounding_box=False)[source]
class PyDvi.Dvi.DviMachine.Opcode_y0[source]

Bases: PyDvi.Dvi.DviMachine.Opcode

This class implements the y0 opcode.

run(dvi_machine, compute_bounding_box=False)[source]
class PyDvi.Dvi.DviMachine.Opcode_y(x)[source]

Bases: PyDvi.Dvi.DviMachine.OpcodeX

This class implements the y opcode.

run(dvi_machine, compute_bounding_box=False)[source]
class PyDvi.Dvi.DviMachine.Opcode_z0[source]

Bases: PyDvi.Dvi.DviMachine.Opcode

This class implements the z0 opcode.

run(dvi_machine, compute_bounding_box=False)[source]
class PyDvi.Dvi.DviMachine.Opcode_z(x)[source]

Bases: PyDvi.Dvi.DviMachine.OpcodeX

This class implements the z opcode.

run(dvi_machine, compute_bounding_box=False)[source]
class PyDvi.Dvi.DviMachine.Opcode_font(font_id)[source]

Bases: PyDvi.Dvi.DviMachine.Opcode

This class implements the font opcode.

run(dvi_machine, compute_bounding_box=False)[source]
class PyDvi.Dvi.DviMachine.Opcode_xxx(code)[source]

Bases: PyDvi.Dvi.DviMachine.Opcode

This class implements the xxx opcode.

class PyDvi.Dvi.DviMachine.DviFont(font_id, name, checksum, scale_factor, design_size)[source]

Bases: object

This class implements a DVI Font.

char_scaled_depth(tfm_char)[source]

Return the scale depth for the PyDvi.TfmChar instance.

char_scaled_height(tfm_char)[source]

Return the scale height for the PyDvi.TfmChar instance.

char_scaled_width(tfm_char)[source]

Return the scale width for the PyDvi.TfmChar instance.

class PyDvi.Dvi.DviMachine.DviColourBlack

Bases: PyDvi.Dvi.DviMachine.DviColour

This class implements the black colour.

class PyDvi.Dvi.DviMachine.DviColourGray(gray_level)

Bases: PyDvi.Dvi.DviMachine.DviColour

This class implements gray colour.

class PyDvi.Dvi.DviMachine.DviColourRGB(red, green, blue, alpha=1)

Bases: PyDvi.Dvi.DviMachine.DviColour

This class implements RGB colour.

class PyDvi.Dvi.DviMachine.DviColourCMYK(cyan, magenta, yellow, dark)

Bases: PyDvi.Dvi.DviMachine.DviColour

This class implements CMYK colour.

class PyDvi.Dvi.DviMachine.DviProgam[source]

Bases: object

This class implements a DVI program.

append_page(i)[source]
dvi_font_iterator()[source]
get_font(i)[source]
print_summary()[source]
register_font(font)[source]

Register a DviFont instance.

set_postambule_data(max_height, max_width, stack_depth, number_of_pages)[source]

Set the postamble data.

set_preambule_data(comment, dvi_format, numerator, denominator, magnification)[source]

Set the preambule data.

class PyDvi.Dvi.DviMachine.DviProgramPage(page_number, height=0, width=0, paper_orientation=0)[source]

Bases: list

This class defines a page.

print_program()[source]

Print the program.

set_paper_size(height, width)[source]

Set the paper size in mm.

class PyDvi.Dvi.DviMachine.DviSubroutine

Bases: list

class PyDvi.Dvi.DviMachine.DviMachine(font_manager)[source]

Bases: object

This class implements a DVI Machine.

_adjust_opcode_counts(opcode_program, virtual_font, characters)
_adjust_opcode_counts_for_virtual_characters(opcode_program)
_load_dvi_fonts()[source]

Load the fonts used by the DVI program.

_logger = <logging.Logger object at 0x30b9810>
_reset()

Reset the machine.

begin_run_page()
compute_page_bounding_box(page_index)[source]
count_opcodes(opcode_program)
current_colour

Return the current colour.

current_dvi_font[source]

Return the current dvi font.

current_font[source]

Return the current font.

current_font_id
end_run_page()
is_current_font_virtual
load_dvi_program(dvi_program, load_fonts=True)[source]

Load a DviProgam instance.

paint_char(x, y, char_bounding_box, font, dvi_font, char_code)[source]
paint_rule(x, y, width, height)[source]
pop_colour(n=1)[source]

Pop n level in the colour stack.

pop_registers(n=1)[source]

Pop n level in the register set stack.

push_colour(colour)[source]

Push the current colour.

push_registers(reset=False)[source]

Push the register set.

registers[source]

Return the current register set.

run_page(page_index, **kwargs)[source]
run_subroutine(subroutine)
simplify_dvi_program()[source]

Simplify the DVI program.

class PyDvi.Dvi.DviMachine.DviSimplifyMachine(font_manager)[source]

Bases: PyDvi.Dvi.DviMachine.DviMachine

process_page_xxx_opcodes(program_page)[source]

Process the xxx opcodes in the page program.

simplify(simplify_opcodes=False)[source]

Simplify the program.

simplify_page(program_page)[source]

Simplify the page.

transform_xxx_colour(program_page, xxx_code)[source]

Transform a xxx colour opcode.

transform_xxx_paper_orientation(program_page, xxx_code)[source]

Transform a xxx paper orientation opcode.

transform_xxx_paper_size(program_page, xxx_code)[source]

Transform a xxx paper size opcode.

xxx_colour = 'color '

Defines colour special

xxx_landscape = '! /landplus90 true store'

Defines landscape special

xxx_papersize = 'papersize='

Defines papersize special

Previous topic

3.1.2. Dvi

Next topic

3.1.2.2. DviParser

This Page