Session 11
Of the videos, this is the eleventh (penultimate) session. It is on DVI files. Including a secret about the “signature bytes” that appear at the end of the file :-)
This will get replaced with the video (if the JavaScript runs properly).
The transcript below is autogenerated from YouTube, and needs to be cleaned up.
Session 11: DVI files
Hi. This is session number… 11. (Take a deep breath.)
File extension: ERR -> LOG
Just thinking… this
morning after discussion someone said
“why do you call it the ERR
file? Wouldn't LOG be a much better
name?” And absolutely, it’s much better. So
it's sold. Our log files are going to
be called LOG instead of ERR from now on.
There will probably be other things that
people who are watching this on videotape
some months from today,
they’ll probably be having a listing of
TeX82 where the module numbers are a little
different and there it
will say LOG already and they won’t
understand what’s going on. I imagine
they’ll be able to sort this out, make
some sense out of a few of the remarks
we make anyway, even though TeX is still
absorbing these new ideas.
Someday it’ll be too late to absorb any
new ideas. So we've got to have all our good
ideas very soon. Now… Dan?
You've got an objection to LOG.
(Dan) LOG does conflict with
the TOPS20 system convention which is
that they’re the output of batch files. Do
you care?
(DEK) Oh I see. You mean if you
gave a batch processing thing it would
give you a LOG file for that too. Yeah, I
see. So these three letter names have
been taken—how about LN, for natural log?
(Laughter)
Okay, well, we’ll play around this
again in discussion. Okay.
Start of talk
The topic of the hour is DVI files and
actually I’ll spend a little bit of time
talking about what TeX does as far as
generating the DVI files is concerned,
but I think I’ll spend more of the
time just explaining exactly what the
meaning of DVI files is.
(The rest of this is not transcribed yet, just lightly cleaned up here and there.)
The reason is
most of your work is not is going
to be doing something with DVI files and
that’s outside the scope of TeX. TeX
considers its job is done when it’s
right written the DVI file but that’s
when the hard work starts you have to
you have to get it you know to make a
really good system you should be able to
handle many people wanting to print
their DVI files in a big hurry and you
might want to queue them up somehow send
them to a printer you have to in order
to print them you have to figure out how
to set how to convert the DVI files to
whatever the printer wants to see and
combine it with pixel files or something
for fonts and so on that’s where the
work is and so you’re going to have
that’s the unless you can find some
system that already does the story they
exist for things like versatech in the
and a cannon and and you know the book
them have to be done over and over for
every device by every person but
otherwise that’s that’s going to be a
major part of your work is is something
that isn’t really part of tech 82 at all
it’s something that goes on after so you
can be sitting there and have tech 82
and it’ll do all these great operations
and give you a DVI file and there you’ll
be sitting with the DVI file you
probably want to know at least what that
DVI file contains and that’s what I’m
going to talk about this hour and we
also have DVI types so you can you can
list the DVI phone it would tell you
what the page would look like if you if
you had a printer to see it on that’s
about the best we can do with the
software that work
okay okay DVI file stands for device
independent and this is our goal is to
best that text should be able to produce
output that that can be used on many
different devices and the director what
drivers have in fact been written for
lots of devices and we believe that any
reasonable device can be driven by a DVI
reading program that section it’s the
device independent file four minutes
part 40 of the right up and it starts
now at module 4 98 which with the
description of the octave of the DVI now
this has gone through three generations
DV the version 0 was the first duck was
the first proposal for DVI then based on
the experience the gain with that came
out with version 1 one of the big
differences was the way it the bites
were packed in words mcarthur because
most people needed them for example on a
36 bit machine that needed the leading
bits to be Nina trailing bits to be 0
instead of the leading bits to be 0 when
they tried file transfer protocols how
many things and that was one of the
major changes between version 0 and
version 1 but now the present
conventions here are version 2 which are
similar to those in version one except
that all that we’ve added more op codes
and remembered all the out codes so you
so you can’t print with you you have to
change your DVI software slightly it has
the same structure but different numbers
to the to the codes and end up
essentially the the revisions that were
done at this stage were to clean things
up by fill fill gaps in the in the
previous thing and make it sort of a
complete and more symmetrical and when
an order that looked a little more
reasonable now
I guess I should go first into the
discussion of what the DVI file looks
like similar to what we say with the TFM
file DVI file is is a again a packed
file of 8 bits so it’s a sequence of
codes 0 to 255 and whatever order you
want to put those on your file doesn’t
matter this line uh because we just put
a week we just put it out as a sequence
of 8 bits and I guess I could also
present one on the screen like we did
for the other case so you can see what
they look like and on this machine so
let’s see I probably have it I probably
have a DVI file and my directory now
nope okay let me see excuse me or like I
think what I’ll do is this I i’ll use
that as a last resort but I’m going to
try to run tech and may can make a DVI
now so let’s see I’ll run any tech which
is the thing that has nothing at all
pre-loaded what’s going on I’m swapped
out this never happens I’d sale we’ve
got four 4,000 we got four million words
of memory requested by all the users at
this point okay well I got in anyway
okay now that’s the debugger that’s
that’s talking to bed i’m talking to and
I better make this a pretty short test
program 00 tech cru who doesn’t match
tangle me again so the fail the song
check what’s going on here okay I’ll run
the preloaded version instead of any
tech
sorry about this i have to anyway you
might as well make up a DVI file and at
this point I have to kill us some of the
things that are pre-loaded because this
is trip this is trip that’s pre-loaded
and I really don’t want that so I’ve got
to kill every Power which is set to sons
ridiculous value that would happen at
every paragraph and i’ll define a new
font let’s say font 1 equals CMR 10 and
then I’ll I think just say hello and get
off so oh I got a select font 12 sakr
and font and then I say hello and get
out so let’s try end hmm ok an over full
box that’s okay excuse me you sit up you
see they where it says hello there has a
vertical rule after it that’s because it
had an over full box i made my age size
zero so no wonder it is over full box
okay i didn’t set age size to anything
okay now well i could print it too we
can go over and see if says hello on
there but now anyway we have a DVI file
and it’s called tech foot DVI that’s
what happens if you don’t give a name if
you got we said last time you know if
you say in put to paper and your names
are paper but it but i didn’t give any
name and so see i got some mail here too
ok so anyway uh the name the default
name if not no no no that was specified
by the first thing you did is t exp UT
ok now over in jax hall we could read
this message that says hello maybe
and see it later on this afternoon but
the DVI file itself is in there so we
could we can first print it in octal
format and then we can print it in more
symbolic form tech put DVI bunch of
zeros there at the beginning it’s not
too long okay that that’s the file and
now let’s let’s explain so anyway it
looks like that will come back and and
be able to understand what all those
sevens are and stuff in a few minutes
okay so that’s that’s a DVI file is
supposed to be short it’s supposed to be
reasonably compact way to describe
printing and it’s also supposed to be
easy for a machine to read efficiently
these were designed by David Fuchs and I
think those two goals are fairly well
achieved of course my this isn’t all
saying hello this is mostly overhead
that’s involved with with all DVI files
that saying what version number they are
and things like that okay the the
instructor the DVI file is best thought
of I think as an interpretive routine we
could have the lights on now and because
I’ll be obviously going on its best
thought of as an interpretive routine of
like I are leased from the old days we
call them interpretive routines these
were programs that go through and and
consider that they are of defining
another another computer and we are we
the interpretive routine are the central
processing unit of this new computer and
we and the interpretive routine is
really a set a set of op codes and
operands and so on something like
machines actually execute in their
hardware but we’re doing it in software
and the opcode that comes along as the
first thing so so it
beginning of each bite and the DVI file
starts out as an opcode and then
depending on the opcode it has certain
operands that that it expects to follow
the opcode start on module five hundred
page 174 of our listings and first op
code is a very simple one set character
0 and it’s just a 0 so if our DVI file
has a bite of 0 this is going to mean
types that character 0 from the current
font we wouldn’t give that first we
better set up a current front because if
current fun is undefined when we start
the machine that we’re simulating here
are defining in this DVI machine is has
a few registers one of them is the font
register f it’s an integer font numbers
can be anything any 32-bit numbers so
this will handle quite a few fonts in
case you now tech will never generate
however for a front number larger than
the number of distinct fronts it handles
which is something some quarter words so
typically we would never get a very
large front number of ourselves but DVI
is is defined to allow large font
numbers because tech isn’t the only
assistant producing DVI files then we
also have a current position on the page
and that’s H and V horizontal and
vertical coordinates on the page it’s
just like Cartesian coordinates except
upside-down that is if we gets bigger we
move down instead of up but H gets
bigger we move to the right so H and V
are these things and the m0 position is
the upper left corner of the page we
start every page at zero and with font
the current front undefined the then we
have four other registers called w x y
and z and these are used to keep track
of spaces that we’re going to be using
over again when we when we skip around
in typically the amount of space that
you move
is is repeated and so we can save based
on the DVI file by not repeating
information over and over again W and X
are two registers for horizontal units
of spacing y and z are two registers for
vertical units of spacing then we also
have a stack built in our hypothetical
machine and the stack contains values h
v w x y and z these other registers get
pushed on and popped up at various times
so that we can in in one bite we can say
push and one bites a pop and and thereby
change a lot of these values go back to
a previous state the current font is not
pushed and popped and and this is really
the because it saves it seems to be
better not to now all of these things
are 32-bit numbers including a sign so
we go minus 2 to the 31 up to plus 2 to
the 31 minus 1 this is a two’s
complement type of a thing and and
there’s a they’re given as when we say
spacing H&V we we mean in terms of
something some unit of measure of course
now the unit of measure in version one
DVI files was called the RSU for
ridiculously small unit it’s intended to
be such a small unit of measure that
rounding errors don’t matter if they
will accumulate the thousand of rounding
errors and you’re off by a thousand RS
use the ike still won’t see it or maybe
a hundred anyway the impossible to
notice well the the around the actual
unit of measurement though is not
defined particularly we don’t call them
RS use anymore in this new report but
there is a there’s a conversion factor
at the end of the DVI file two numbers a
numerator and denominator that we that
that says if you multiply by the
numerator and divided by the denominator
then you get units of I think it’s ten
to the minus seventh meters or 10-8
smita something like that so it’s so
basically we do have a metric system
involved here in tech always sets those
numbers to the right to the right value
so that that the units that tech outputs
is scale points same as tech users
everywhere else in its internal
conversion which is pretty ridiculously
small unit so scaled points is now to to
the 16th of them make one printers point
is rationally converted by a certain
fraction into these into the metric
system in case that it’s for other other
programs writing DVI files would find
other units to be appropriate ok now the
DVI type program shows in great detail
that’s one of these things in the tech
where book shows in great detail how we
recommend rounding positions I in the
DVI file to lower rester devices I
probably should meant to talk about that
a little bit later but there’s but you
see we have two kinds of units we have
these ridiculously small units which
we’re going to be giving our
measurements in in a DVI file and then
you have pixels of something on your
actual device and you have to convert
between the one and the other and proper
way to do it is to keep most of your
arithmetic in the in the DVI units and
do rounding to pixels at key times like
at the beginning of a word something
like that okay now if you want to set
types of character number zero from font
from the current font f you just give
byte 0 and what could be more compact in
that I mean you okay similarly one up to
127 will Lil typeset characters one
through 127 respectively now we couldn’t
do this for all 256 characters in the
front because we only have 256 opcodes
and so if you have to set a character
number 128 you do it in two bites and
there’s a
instruction set one this one’s called
set one which is followed by the
character that you’re supposed to set
and so in the notation in the book it
says C bracket one in the brackets is
the number of bytes that we assume the
upper end is 129 is set to which is c2
and 130 these are not generated by tech
82 this would be to set three bite and
four byte characters there’s even a set
for so all of these possibilities said
for would say that that AC so if I gave
131 and would say reading the next four
bytes and then whatever those four bytes
are that’s the number of the character
that you’re supposed to set next in the
current file so we can handle France
with 22 the 32 different characters in
them of a DVI format is not tried to be
restricted it’s supposed to be useful
for I can smell even can even them
things now are also people might use
this somehow they might have some
convention for these bits like this
reflects the color or something like
that who knows but right tackle only
output see one for the characters 128
through 255 okay now this is typical of
the commands and DVI that there will be
versions one two three and four
depending on how many bytes you need for
the operand so that the command will
tell you so if you if you are only if
you only need a 2.2 byte number then you
use the opcode that says that says so
that only two bytes are needed
afterwards so this is a 3 this is a
2-byte total command one for the opcode
and one for the character this would be
a 5 bike total command question no Dave
what
now all of these characters not only all
these set instructions not only types at
the character but they also move H to
the right by the width of the character
so this is this this is set character is
0 and H is set to h plus the width of
that character so the DVI reading
programs have to have access to the
width information for each character
just as the just as tech does and so V
VI reading programs will use the same
some check that tech had in order to
make sure that it had the same in that
it makes the same assumption because
tech isn’t going to tell the DVI file
how wide that character is DVI reader is
supposed to get that out of some other
thing we put this information also in
the pixel file so that the pvi reading
program doesn’t have to read both TFM
file and pixel file so meta font will
put this information out twice with the
same sunk check so that you can make
sure that your for your information is
consistent but this is important for
packing the packing the total length of
keeping the totaling to DVI file down
okay now there’s also a set rural
character which is 132 and this one is
followed by two operands a and B each 4
bytes lon all four byte long parameters
are signed that means that if you have a
4-byte long parameter the first it could
be between minus 2 231 and so I’m
looking at the first bit of the sign
however in these in these one and two
and three bite characters it’s always
plus so the character the the range here
is for example in seat in set two is
zero to sixty five 5 35 not you don’t
have a negative character number for
these but a 4-bike number is always
considered to be signed so that we don’t
overflow
all the constraints of a 32-bit computer
we supposed to be able to read this on a
32-bit computer which would want a form
for byte number to be considered signed
a signed integer I guess and the set
rule instruction is like said care that
it also will will advance h after the
rules to another now eh eh is the height
and B is the width of this rule and if
if the height is zero or the width is 0
then we don’t do anything except move by
B if any of these are negative so b is
minus 5 for example we wouldn’t put any
rule there because what’s the rule
that’s minus five things wide it’s a
it’s a kind of invisible or you could
imagine tearing a hole in the paper or
something I don’t know but all but it
will move H and H will decrease by five
in that in that case now there are rules
specified in the tech 82 manual so that
you should so that the rule rules there
are things in the tech industry could
get consistency between tech and meta
fonts so that if somebody designs a
character using meta font and has a
certain conventions about how that he’s
drawing a straight line in his character
and then we have a DVI command that said
sets a rule that we can guarantee that
we’re going to line up the pixels
perfectly so that the rule have the same
number of pixels high as the other and
those are spelled out in the in the book
are precisely so it should be possible
to to have consistency across across
these things without no matter what the
rounding conventions are so we designed
the thing with with that uppermost in
our mind that we should be able to to
ensure perfect alignment this is
important for example of embarrassing
cases if you have up our large radical
sign now actually has a little bit of a
la atop to it
because otherwise the on such a large
case it would look bad if you if you
variable was too close to it so we give
this extra space in in the radical sign
itself well then tech is going to put a
rule next to that and the positioning is
Bay it says that the the the rule the
baseline of the square root sign is
exactly the same as the baseline of the
rule this means tech computes the same
number for both of these and and they’re
given and precisely the same DVI
coordinates in terms of V here so
there’ll be exactly the same height V
about the line this rule will be set
bias by exactly the height of this
character and therefore we should get
exactly the same output if if the DVI
certain servers are implemented properly
this should be exactly as thick in terms
of number of pixels even if we move this
up on the page one third of a pixel the
rounding should have been exactly the
same for both calculations for this one
in this one wasn’t true in the present
version attacked and but we get positive
alignment in the other other version
this by the way big square root would be
an extensible character but the top part
has this has this feature set rule i
might mention goes up above that that
the rule starts at the lower left corner
the current position HP is the lower
left corner of the of the rule and then
so this is your reference point then you
move h to the width of the rule
afterwards now of corresponding to these
set commands we also have put commands
like 133 i believe is put one I won’t
write them all out partly I don’t have
have room for it put one followed by a 1
character code and the put commands are
just like the set commands like this
would put one month’s like set one you
give a character code that you’re
supposed two types it the only
difference is that H doesn’t change
this is when you’re setting characters
above each other for example you would
you might like to do that if you’re
doing an extensible character like this
and just put out the pieces of the
replicating pieces however I don’t think
tech deck tins 82 actually generates
that command because we not we don’t
have character nodes in vertical mode so
there’s put commands and put rule and so
on all right the operation 138 is a no
op it does nothing and it just in case
you have you for some reason you want to
fill space or blank something out it’s
something that tech doesn’t generate but
you can have these between DVI commands
if you want them for some some reason or
other convenient to your software you
can’t put a no op in in the middle of a
program it has to be between between
commands you couldn’t put a no op
between a set one and it’s operandi was
how would you know that that was you
know that it wasn’t supposed to be
character number hundred thirty-eight
that you were doing there but you could
what you can put it between commands all
right okay well anyway there’s I don’t
have to give these numbers anymore let
me just give the mnemonics no op and
then there’s not pop and yup and pop
well push comes before pop but there’s a
lot of these I’d seem to rhyme they
bob is beginning of the page and this is
the long one it’s followed by by 11
parameters each four bytes long we don’t
expect this happens very often typically
but it’s followed by C 0 4 bytes up to c
9 for bikes and then by another probe ID
parameter of P which is a okay now p is
a pointer to the previous Bob in the
file and if it’s the very first pop in
the file p is minus 1 so this allows you
to go backwards through the file
skipping back pages from the end of the
file back to the front and we use this
on some machines i think on the canon i
use it for example because the the paper
comes out and you would like it to be
stained and it’s text so that it’s
better to print the last page first
otherwise after you get your output you
have to you have to go like this to get
them right so so they read the file
backwards and bring it in that right
yawn yes it takes so long to pick up the
microphone man a few words okay we’ve
got so so this allows you to go back
through the file from P to the previous
pop okay beginning beginning a page the
c02 ce9 are the values of tech our cross
reference values that a person can use
in order to identify a page location in
tech puts out the values of the first
ten counters count 02 count nine so for
this purpose so you can identify a page
bye-bye it’s connor now what you usually
get on your screen is just the value of
count 0 but if you but sometimes people
like to you know we’ll have have more
sub structure to this and so David
wanted to be generous so we put all you
put 10 of them out I don’t know if
anybody’s ever used more than three but
our convention that we’ve been using
with some success has been to print them
out with dots for
ample one dot-to-dot one would be a page
where count 0 is 1 and count 1 is 2 and
calm 3 is 1 and then when we give the
starting page command on some say we’d
like to start at a certain page if we
said one dot star dot to this would mean
find the first page that has the form
count one is one count the count 0 is 1
count two is two and count one we don’t
we don’t look at then it would print out
it also depending on how many dots we
got it would print out that Oh as its as
its printing on on the on the console of
the printer it would say I’m printing
page something and it gives them we give
the first three counts if I specified
that if I specified in my starting if I
said my starting page number was one
star to star then it would give me four
counts to show what page it’s at this
convention seems to work out reasonably
well for displaying page numbers as
you’re doing if you have question one
Bob for every ship out exactly a ship
out set puts out a bob and in yup which
is ender page right mm-hmm so now when
you give a pop it starts out initializes
all its registers 20 and the current
font is undefined and the stack is empty
you’re supposed to push and pops are
supposed to be all contained before you
get to the e op so the stack should be
empty when you get to the end of page
but the end of page is a time when you
you print everything now when you in
most cases when you’re when you’re
implementing this you’ll be doing yup
you’ll be doing a lot of computation at
the time of EF that’s not reflected in
my DVI type program because for most
devices you have to sort the information
into order by some coordinate or other
either horizontal or vertical or
something now the things that you get
out of tech are not guaranteed to be in
any particular order
they tend to be in order but not always
because subscripts and superscripts for
example or people doing forefront of
things with negative glue could
certainly review the order the order
that comes out in is somehow what we
would call preorder in computer science
as far as the list structure is
concerned we just unwind the list
recursively and take things as they as
they come to us that tends to be in
order and that tends to help sorting
routines but tech doesn’t do the sorting
itself that’s the responsibility of your
DVI reading program if you if you need
to sort some devices don’t need it some
some devices too but what you typically
do is you get to a Bach and then you
start you start looking at the rest of
the bytes and start and this gives you
coordinate positions and characters and
you start building a table and then when
you get to the e op put that table we
also build in a protection against
overflowing the table so the table gets
too full then we sort it now put that
that part of it right there and then not
continue on with the next partial part
of the page to and sort sort each part
we will break up this information if we
have to on our alpha type serving things
this turned out we didn’t need it until
people started using our our programs
for vlsi layout and so right now for
example when you get a son workstation
it was printed because of vvi files in
tech and our software for driving the
typesetter because we the masks that
were made for for some of the boards
will print work we’re done with software
that had a huge number of commands
between bop and yup okay oh now push
says take your stack and your HB WXYZ
registers go on to the stack and die and
on top of whatever was there before do
you don’t change any of their values and
pop takes those takes low values from
the stack and put some in
to those registers for getting what the
other registers were and typically why
would you do that well it’s something it
goes something like this but most pages
might say consists of lines and so so
the page is a vertical list and then
when it then it comes to this point and
it gets to the base line here and then
it says push and now it goes into a
horizontal list and starts moving across
this way when it says pop later on we’re
right back here then we can do a
vertical motion gets us to here we push
again and do this kind of computation at
the end this vertical motion will be the
same as that one so we’ve recaptured the
same the previous value we don’t have to
physically we don’t have to push is a
pop is a fast way to back up to where
you were before you see helps a lot with
leaders and other things too that would
tend to fill up these DVI files okay now
the other the other commands are just 44
motion primarily and they there’s so
many of them they fit into a simple
pattern and this is right one right to
write three right for I’ll just say
right one as a representative of this
class and it’s followed by an amount of
vertical or horizontal motion be now in
this case b is assigned quantity so this
is between a minus 128 and less than a
plus on or 28 is it needs in these
commands where we’re talking about
motion we use it so we use a sign number
so right might actually send you to the
left and the same with right to write
three right four depending on how many
right one is actually rather uncommon
because these DVI units are so small
that that we would have to move at least
at least 200 or something in order to
see it but it could happen the but
usually right to is in may is in the
ballpark of the
motions that will actually be making and
since we since the set character
commands already do the right word
motion most of the time this will be
moving from word to word or just doing a
little kerning between between letters
of the word then there’s w0w 12 w 4 and
interestingly this this the definition
of the right command it does two things
it says h 2 h plus B and it also sets w
to be so the amount that you move by is
saved in this register double wait a
minute no no that’s not right no I’m
sorry it doesn’t go any sorry w1w want
is a command that sets h 2 h plus B
there’s a beam be one associated with
the sky h 2 h plus B and W to be and
similarly w 4 is a followed by a 4-bike
parameter and does the same thing now w0
just sets h 2 h plus W so that whenever
we have the right amount of motion
already in register w then we get by
with a one-bite command and tech has a
neat way of that seems amazingly
effective and producing one byte
commands on the examples I tried it
learns the kind of spaces that you’re
making and the type and it you know in
normal text each line typically as one
or two spaces that are there are 14
currents and 14 between letters between
words math formulas have another kind of
spacing that goes around the operators
and things like that but this seems to
learn them very quickly so that we can
get by with one bite commands quite
often there’s X 0 through X 4 same deal
but using X instead of W we have these
two registers each one can be used
there’s no the present version of tech
uses w only for space between words and
x only for currents but tech 82 has an
algorithm that tries to be to try to be
clever in assigning these and so you
can’t assume that it just because it’s
an ex that it’s either occurring are
something else that generated it now
cook now similarly to the right than W
and X we have bound y and z exactly the
same except you replace horizontal by
vertical motion in all the commands well
that takes us up to operators e4 which
is 107 170 we still got up to 2 to go up
255 possible opcodes well the next sixty
four of them are all just to change
current fine so 171 is set font 0 and
your font num 0 excuse me so is the
official name f NT and um and up to
whatever 234 which is front number 63
this command sets f20 and up to 63
that’s all it does but we got to set the
current front number and then we have
front one two three and four 244 font
numbers of one by two bytes three bytes
four bytes so if we tech assigns its
fonts internal codes and the first font
that you named will get number 0
actually internally it’ll get number
base plus 1 but this will convert to 0
in the DVI file and so only if you’ve
given more than sixty four distinct
France in your job will you ever need of
this command 235 which is the fmt one
instruction which is followed by one
byte front specification and you could
have
any anything up to four bites one
proviso is that that you’re not allowed
to declare font number minus one phone
number minus one is it is the only one
you’re not allowed to have well there’s
two more up codes and then its thinnest
on front for is 238 so 239 is xxx this
is what this is what comes out of the ex
and instruction and so you people the
interest in this for extensions to tech
when somebody says X send in tech X end
and then you give give something here
this is expanded as if it was in the
next step the any macros are expanded in
this text and the resulting characters
are placed after an ex ex ex command in
the DVI file associated with the current
H&V where you are where this X and
appeared in the paragraph and it’s
followed by one bite that tells how many
bytes are following and then by the text
in text in in text internal ascii code
that’s invites lon now here if people
feel strongly well okay somebody
suggested the other day that he doesn’t
want to restrict this m to 255 that he
would like to be able to have x end of a
huge long piece of text that coming out
here right now we’re respecting it to
255 maximum through xn my inclination
right now is that if you want to send a
large amount of information your best
bet is putting it in a file and naming
that file here but if there’s a strong
call that we need really an xxx to
instruction that will take a to bite em
and then we could go up to 65 k bytes I
wouldn’t imagine wanting to six foot
stick more than that into the
middle of a DVI file for sure then what
we would have to do is change the few
programs that we already have reading
this this version of DVI this if attack
chain is ever to be made it should be
made now because it could it could be
done by a few people in a few minutes
before this gets frozen but but next
year be very difficult we have to say
that’s DVI version free and so we still
have a time to make such a change the
only idea I’ve ever heard of that might
might be useful for putting into present
DVI file so you might think about that
and give me some comments on it after
there are right now we just have XXX
limited to maximum 256 bytes in this in
this xn the last op code is 240 which is
the post amble and that’s the bestest
range part of BPI files which I’ll be
talking about soon I of course 241 to
255 aren’t defined and they’re there so
it so it wouldn’t be that hard to switch
in XXX 1xxx to there we still have a few
left for for future use and no I know
really great ideas as to what to do with
them Roger oh yeah on the current TV I
you have a trailer bite of some sort
that comes after the post handle I don’t
see that in this list that 0223 in the
y’all talk about that that doesn’t it it
it the only it only has meaning at the
end of the post amble so it’s so so
that’s a ok now the post amble is is so
if we’re reading from the front of the
from the front of the file we get to we
get to 240 this should occur only right
after a neo p after end of page we
should never run into a bear post amble
however techwood tech generated one the
other day and i found out why i think it
was in the middle of this can’t happen
error
so it didn’t get to the end of a pay
this can’t happen error occurred in the
middle of the DVI in middle of a ship
out so you know it terminated right away
but but in order to close out the DVI
file that wrote a post amble so so it is
possible you know to protect to generate
this and the DVI reader would would
reject click the file then when it got
there and and and saw a post time were
right in the middle of page now the post
on bow is name is is one of the words
that we had to make sure that we could
hyphenate because it doesn’t appear in
the English language dictionaries and in
fact the present tech hyphenation Adam
calls it opposed tambul so we had to put
it in that list of words that you look
like that was there yesterday to get it
hyphenated properly it was it’s a client
word but it means that we’re giving
information that comes after instead of
before but we really read it first we
need the information first but tech
doesn’t know it until the end so now
it’s uh it would it the alternative of
saving enough room at the beginning of a
file for it was was was worse than what
happened so David had this neat idea and
it seems to be working fine to put the
information at the end of the file and
so at the very end of the file comes
this this post hammer which is a huge
long list of information it’s in module
5 03 of your book tells you what it is
I’ll just read it to you first the first
thing after the PST is four bytes that’s
the pointer to the final blp in the file
so this is the if there weren’t any Bo
piece at all you get minus one there but
this is the this is where you can start
going backwards through the file then
comes the numerator and denominator that
i told you about telling you what your
DVI units are defining those and then
comes what is it m which is the
magnification parameter so person in
text said magnify two thousand there
you’re going to get the number two
thousand here
this is something that is supposed to be
applied globally throughout the entire
file after everything else has been said
and done also magnified by this mount so
effectively it just it just goes in with
the numerator and denominator and and
the true calculation to convert DVI
units to to these 10 to the 7th minus
seventh meters is M times n divided by a
thousand d that’s the that’s the factor
that’s used when you generally compute
that in floating point arithmetic now
magnification passes through only in
that way intec unless you say as for
true dimensions you can you can ask for
true inches true points or something in
a dimension in tech and and if you ask
for say 22 inches and your magnification
was 2000 then tech would convert that to
invention to one inch so that later on
when you magnify it they are you get two
inches but if you haven’t said true
anywhere in your tech file then the only
effect of the magnification parameter is
to change this thing in the post amble
that comes out here when you write DVI
software it’s also a good idea to
provide the user with a I mean in many
cases it’s a good idea to provide the
user with a chance to override the
magnification option at the printing
time and say just don’t you know just
does pretend that the the tech job said
to magnify a little bit more so of it so
that you don’t have to rerun the tech
job just can say okay spool is at fifty
percent larger if you have the fonts at
that size you can do it some people
asked about about storing fronts at
different magnifications we we since we
can say CMR 10 add 15 points in cmr 10
at 20 points that means that we should
have it in our
in our front library these these options
perhaps and how to name them well it
depends on your on the system you’re
using the the Dover software requires a
certain naming convention that has quite
a lot of structure but on other systems
like when we use the Canon we we work
with with just the ordinary file system
in our computer and a file that’s been
that’s been magnified to 44,000 for
example gets a foot gets a suffix be
called CMR 10 dot are 40 and at 10 point
it would be called are 10 and so the
server just looks for a font file or
pixel file with us the suffix that
matches the amount of magnification on
our alpha type we use more digits than
that but it’s something like that we say
it’s an ant file for the Alpha type and
we call it the suffix on it would be
something like 1000 aunt fora for a
normal font and twelve twelve hundred
and four front that’s been magnified 12
on to something like that is we just put
in the extension of the file name the
indication as to these pixels were
generated at a different at a different
size from the from the other one what we
do then in our software is we find the
smallest size greater than or equal to
the one that we’re supposed to print at
and then we try to shrink it down if we
can with with the printing hardware if
you can’t do that and not we complain
and say well we had a substitute of fun
we try to substitute the closest we can
that’s the kind of issue anyway
magnification is this next thing in the
post amble then there’s L and you Ellen
you are the measurements of the tallest
page the height plus depth of the
tallest page and the width of the widest
page so when we start typesetting a page
we start at the upper left-hand corner l
would represent the maximum height and
depth of that page w you
you is the I couldn’t call it W because
W is one of the registers of the KPI
machine so L is the maximum of all these
numbers you is the maximum of all these
sizes however this does not this does
not tell you where the characters really
are I mean somebody might’ve had an over
full box that sticks out here or done
backspacing or something on the margins
and there might be characters outside
these things this is just the box this
the size of the box like it was a v-back
was certain height and depth the maximum
size of boxes that were shipped out but
it’s not actually computed by the
character the position of things in the
box and these numbers the purpose of
these numbers is so that you might want
to put in your spooling software
something that tries to lay things out
on a piece of film and we wanted these
things to like if you know if you can
fit four on a four of these pages on one
on one piece of your medium what that
you’re printing on then you could you
could save save the other tend to be
expensive on some prototypes sou compact
within yourself but we never really have
implemented that yet we just put yelling
you in for that purpose we’ve got other
ways of specifying the user gives us a
option file that tells where to put
where to put the pages for a particular
job each job has its own option for
ireland’s that way now let’s see I
covered Ellen you then comes T s and T s
is the I think the greatest yeah the
maximum stack depth if you it tells how
big a stack you have to have in order to
handle this this DVI file and T is the
total number of pages in the file this
in case you wondered to a number of Bob
commands after that is the all-important
font definitions and it and teck teck
will only put out the font definitions
that are actually used the if you if
you’ve declared fonts but never
set any characters from the funds it
doesn’t come in the file and the front
definition consists of the internal font
number so that you can match it it’s
like font number 0 through 63 typically
then you got a checksum for the front so
that you can so that you can do in
checking make sure that this that you
use the same information that their tech
did when it generated this file you got
an extra scale factor for the font this
substitutes for the for the design size
of the font and then you’ve got the area
the font area and the font name that are
just passed to you and as an ASCII
string we do this for each font and then
we have a minus 1 4 bytes representing
minus one to tell you that you’re at the
end of the fonts and that’s why font
code minus one was not allowed because
as soon as you get to a minus 1 yard
then Venice then now after that phone
number minus one we’re reading on module
504 then we got a pointer to the post
ambika man so let’s see if I can make a
little picture that my DVI file is going
along and I’ve got a minus one sitting
there and then I’ve got a pointer to the
post amble command four bytes that give
the address of the post animal command
where Laura tiered where it appeared
here after that comes the identification
bite which is too so this is version two
DVI file and then we’ve got out any
number eight ER than or equal four bytes
that are all equal to 2 23 now I gotta
let you in on a secret 223 if you put it
in hex is DF and David fuchs is the one
who designed DVI files I believe it’s a
little mutt too much of a coincidence so
we call this the signature bytes of the
DVI five
and and we can put a least four of those
in there and this is so this is to make
it possible for if things are packed
four bytes to a word to find the end of
the file by means of routines that exist
on most systems now Tanner Pascal
doesn’t allow you to start reading a
file at the end and do random
positioning going back through the file
but most systems do allow you to do this
and if you if you don’t have such a
system then you start at the beginning
and zip up to the post down below and
then start at the beginning again and
cut and start your type setting but most
systems you can get it from the back so
you come back to the end of the file
read back over the 220 freeze check that
you got version 2 then this tells you
where the post amble is the post amble
tells you where they the previous Bop is
if you want to go backwards or you can
go back when anyway you can read all the
fonts here and do the new the checking
the DVI the DVI type program that we’ve
distributed here includes both options
and you can and you can see the code
that would read the file in both
directions yeah time is getting short
but i would like to run DVI type on this
file so you can see what it looks like
on a reasonable file so let’s go back to
the computer and see and I’m this was
called tech foots evi and our output to
tech foot that tight let’s say ok now
it’s going to ask me for it’s going to
ask me for several levels for several
things and it also says I can type ? for
help and two for a complete listing 0
for errors only one for something in
between I’m going to get a 2 for a
complete listing the starting page I can
I can use the default if I said star dot
star however i’ll show you that just
will print out but both count numbers
count 0 and count 1 both of which happen
to be 0 i guess maximum number of pages
is you know i’ll just type just a lot to
do a million pages if they’re either
many then it will convert things to
pixels per inch and if I want to if I
want points instead of if I want points
those seven be 227 points in 100 inches
so i’ll type 72 27 / 100 the
magnification i can i can just say
return to keep the old magnification on
any of those i could have typed help and
I was in now it’s done it so I can look
at the file texsport type and this
should be the DVI file that we created
got to move it over to the right again
okay so i told me the options that i
selected and post animal starts at byte
number 68 the bites are numbered
starting at 0 gives me the numerator
denominator magnification was set at
2000 because of the the trip file
actually set magnification 2000 so
things are getting magnified twice and
we loaded font 3cm are 10 at size 10 DVI
units but that actually will be
magnified ok now the because the DVI
units are are magnified ok so beginning
so byte number 0 was the beginning of
page 0 point 0 and if I had said starve
dot star that startup star than I would
have seen all the counters of that page
then it says down three four or five 5 1
11 so so the vertical the register V is
moving down the page by four and 55,000
DVI units has a warning here says the
absolute value of v is greater than zero
well I don’t understand that at all I
have to think about that what’s so bad
about that
what no all right do you think so that’s
don’t let that line is is complete okay
well that doesn’t seem oh oh I see yeah
yeah if you look up here it says max v
equals zero you see that was the the max
V is the largest supposedly largest v
that’s that you’ve got and this is
warning me that I’ve exceeded that with
some characters outside of there okay
well thank you so then I push and then
get my first but a box and I’m end this
comment here that I’m at level 0 of the
stack has the following values of h VW x
y&z the eighth double h and double V are
the are rounded two pixels which in this
case is rounded two points so I’m 14
points below the upper corner of this
thing because of probably the baseline
skip which i’m not sure what it was must
have been seven points or something like
that for the top baseline oh now then at
bite 50 of the DVI file i selected an
instruction font number three so the so
i picked up font number three font
number zero one and two were preloaded
to be those trip fonts that i didn’t
actually use the so the current front
now is see mr 10 in invite 51 of the DVI
file i’m setting character 72 which is
ABC which should be a capital H for
hello and you see down there in brackets
there’s a comment if I hadn’t asked for
for level two which gives me everything
I would have just seen hello would have
gotten a much more terse description
from DVI type I’ve asked for everything
when i said the output level is to here
so that transcribes all of these
characters into hello and then it set a
rule this was a rule put out for an
overflow box because when
one thing that I had set in that you
know pre-loaded option was that that
every over full box should get a rule
that’s 55 points wide now I look at this
rule it’s 14 x x 10 wide that’s because
it’s been magnified twice so I’m
actually getting one 10-point a rule at
ten points wide so if we went over and
look at the hard copy that came off the
Dover we would have seen a rule at the
end of the word hello that was 14 points
of high and 10 wide and the Hello would
have been set at 20 points instead of at
10 points then it pops and we go back to
the previous level of the stack and the
page and that was it so that’s the deep
that’s the idea of how the DVI file for
a short program time is running out now
so we’ll have to break and meet again at
three thirty for our final session
That's the end of this page. If you have any feedback about anything on this site, you can contact me here. To go back to the top-level page (if you are not on it already), click here.