summaryrefslogtreecommitdiff
path: root/dviware/dvi2tty/DVI.format
blob: 4ce5d3936a38fb5e0d2021c76685588943cb118b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*


================================================================================
==                          DVI file format                                   ==
================================================================================
no_ops          >= 0 bytes     (NOP, nops before the preamble)
preamble_marker    1 ubyte     (PRE)
version_id         1 ubyte     (should be version 2)
numerator          4 ubytes    (numerater must equal the one in postamble)
denominator        4 ubytes    (denominator must equal the one in postamble)
magnification      4 ubytes    (magnification must equal the one in postamble)
id_len             1 ubyte     (lenght of identification string)
id_string     id_len ubytes    (identification string)

no_ops          >= 0 bytes     (NOP, nops before a page)
begin_of_page      1 ubyte     (BOP)
page_nr            4 sbytes    (page number)
do_be_do          36 bytes     (filler ????)
prev_page_offset   4 sbytes    (offset in file where previous page starts, -1 for none)
... PAGE DATA ...
end_of_page        1 ubyte     (EOP)

no_ops ???      >= 0 bytes     (NOPS, I think they are allowed here...)
postamble_marker   1 ubyte     (POST)
last_page_offset   4 sbytes    (offset in file where last page starts)
numerator          4 ubytes    (numerater must equal the one in preamble)
denominator        4 ubytes    (denominator must equal the one in preamble)
magnification      4 ubytes    (magnification must equal the one in preamble)
max_page_height    4 ubytes    (maximum page height)
max_page_width     4 ubytes    (maximum page width)
max_stack          2 ubytes    (maximum stack depth needed)
total_pages        2 ubytes    (number of pages in file)
... FONT DEFINITIONS ...

postamble_offset   4 sbytes    (offset in file where postamble starts)
version_id         1 ubyte     (should be version 2)
trailer         >= 4 ubytes    (TRAILER)
<EOF>


FONT DEFINITIONS:
   do {
      switch (c = getc(dvi_fp) {
          case FNTDEF1  :
          case FNTDEF2  :
          case FNTDEF3  :
          case FNTDEF4  :  define_font(c);
          case POSTPOST : break;
          default       : error;
      }
   } while (c != POSTPOST);

===== A font def looks like:

1,2,3 or 4 ubytes TeXfontnumber for FNTDEF1 .. FNTDEF4
4 ubytes checksum
4 ubytes scale
4 ubytes design size
1 byte deflen1
1 byte deflen2
deflen1 + deflen2 bytes fontname.

===== A special looks like:

1,2,3 or 4 ubytes telling length of special command for XXX1 .. XXX4
all bytes in the special command are used as defined in the dvi driver.


-Marcel Mol


*/

From: schrod@iti.informatik.th-darmstadt.de (Joachim Schrod)
Date: 2 Jan 92 18:26:27 GMT

Since this question comes up often, I post the answer:

The following file format definitions are part of the TUG DVI Driver
Standards Draft:
	DVI
	GF
	PK
	TFM
You can ftp them from ftp.th-darmstadt.de, directory
pub/tex/dvi-standard/standards.

Take either draft-0.05a.tar.Z (the complete standard) or
<xxx>.tex+fileform.sty where you have to replace <xxx> by dvi, gf,
etc.
   In the latter case -- when you fetch single files -- you'll need
to add a LaTeX standard frame (\documentstyle{article} +
\begin{document} + \end{document}) to get a full, LaTeXable document.

--
Joachim

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Joachim Schrod			Email: schrod@iti.informatik.th-darmstadt.de
Secretary of TUG DVI Driver Standards Committee