summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvi2tty/DVI.format
blob: a48ad47e4d970826ffdde1ba6122e9e02ead12fb (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
/*


================================================================================
==                          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.


*/