% TeX source file for creating TRIPVDU.DVI, a torture file for DVItoVDU
% (using the same philosophy as Donald Knuth's torture test for TeX).

\nopagenumbers
\topskip 0pt
\parindent 0pt
\parskip 0pt

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 1
% This page is completely empty.

\message{Empty page.}
\null
\vfil\eject

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 2
% This page is empty apart from some \special commands.

\message{Empty page with special commands.}
\null
\special{DVItoVDU shows location and first 64 bytes.}
\vskip 1in
\hskip 1in
\special{1234567890123456789012345678901234567890123456789012345678901234}  % 64
\vskip 1in
\special{}   % 0 bytes
\vfil\eject

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 3
% This page has 1 black pixel at (0,0).

\message{1 black pixel at (0,0).}
\hrule height 1sp width 1sp depth 0sp
\vfil\eject

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 4
% This page will fill an A4 sheet with black pixels,
% assuming A4 paper is exactly 210mm by 297mm.

\message{A4 sheet full of black pixels.}
{% change page size and location temporarily
\hsize 10in
\vsize 12in
\hoffset -1in
\voffset -1in
\hrule height 1sp      width 209.95mm depth 0sp
\hrule height 296.95mm width 209.95mm depth 0sp
\vfil\eject
}% reset page size and location

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 5
% Assuming a resolution of 300dpi, this page is 1 pixel wider and longer than
% previous page.  DVItoVDU should detect that page is off A4 paper.

\message{As above but 1 pixel too wide and too low.}
{% change page size and location temporarily
\hsize 10in
\vsize 12in
\hoffset -1in
\voffset -1in
\hrule height 1sp   width 210mm depth 0sp
\hrule height 297mm width 210mm depth 0sp
\vfil\eject
}% reset page size and location

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 6
% This page has a rulelist with a full ruletable (= 300 rules).
% Pages 6 to 9 test the list manipulating code.

\message{Page with ruletablesize rules.}
\newcount\temp
\temp=300
\loop\ifnum\temp>0
   \hrule height 1sp width \hsize   % 1 pixel high
   \vfil
   \advance\temp by -1
\repeat
\vfil\eject

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 7
% This page has ruletablesize+1 rules (so rulelist has 2 nodes).

\message{Page with ruletablesize+1 rules.}
\temp=301
\loop\ifnum\temp>0
   \hrule height 1sp width \hsize   % 1 pixel high
   \vfil
   \advance\temp by -1
\repeat
\vfil\eject

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 8
% This page has a charlist with a full chartable (= 3000 characters).

\message{Page with chartablesize characters from one font.}
\font\small=cmr5
{\small \offinterlineskip
 \temp=30
 \loop\ifnum\temp>0
    \leftline{iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
              iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii} % 100 chars
    \advance\temp by -1
 \repeat
}
\vfil\eject

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 9
% This page has chartablesize+1 characters (so charlist has 2 nodes).

\message{Page with chartablesize+1 characters from one font.}
{\small \offinterlineskip
 \temp=30
 \loop\ifnum\temp>0
    \leftline{iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
              iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii} % 100 chars
    \advance\temp by -1
 \repeat
 \leftline{i}                      % the extra character
}
\vfil\eject

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 10

\message{Multiple TeX page counters.}
\footline={\hss\tenrm\folio\hss}   % turn on page numbers
\pageno=0
\count1=1 \count2=2 \count3=3 \count4=4  \count9=9
\noindent
This is \TeX\ page [0.1.2.3.4.....9].
\vfil\eject

\count1=0 \count2=0 \count3=0 \count4=0  \count9=0   % reset TeX counters

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 11

\message{Negative TeX page.}
\pageno=-11
\noindent
This is \TeX\ page [-11].
\vfil\eject

\pageno=12         % DVI page = TeX page again
\nopagenumbers     % turn off page numbers again

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 12
% This page has characters from many fonts.
% Note that the page is off the right edge of A4 paper.

\message{Page with characters from many fonts.}
% avoid redefining plain TeX's \i, \j etc.
\font\Fb=cmr5
\font\Fc=cmr5 scaled\magstep5
\font\Fe=cmr10 scaled\magstep5
\font\Fg=cmbx10
\font\Fh=cmbx10 scaled\magstep5
\font\Fj=cmsl10
\font\Fk=cmsl10 scaled\magstep5
\font\Fm=cmtt10
\font\Fn=cmtt10 scaled\magstep5
\font\Fo=cmss10
\font\Fp=cmcsc10

\leftline{\Fb These characters are from CMR5.}
\leftline{\Fc These characters are from CMR5 scaled magstep5.}
\leftline{\tenrm These characters are from CMR10.}
\leftline{\Fe These characters are from CMR10 scaled magstep5.}
\leftline{\Fg These characters are from CMBX10.}
\leftline{\Fh These characters are from CMBX10 scaled magstep5.}
\leftline{\Fj These characters are from CMSL10.}
\leftline{\Fk These characters are from CMSL10 scaled magstep5.}
\leftline{\Fm These characters are from CMTT10.}
\leftline{\Fn These characters are from CMTT10 scaled magstep5.}
\leftline{\Fo These characters are from CMSS10.}
\leftline{\Fp These characters are from CMCSC10.}
\vfil\eject

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 13
% This page has characters from many non-existent fonts.
% DVItoVDU should warn user about non-existent font files and
% continue as best it can by loading dummy font info.
% Note that the page is off the right edge of A4 paper.

\message{Page with characters from fonts at unknown magnifications.}
\font\Fr=cmr5 scaled 500
\font\Fs=cmr5 scaled 330      % .99pk at 300dpi
\font\Ft=cmr10 scaled 99
\font\Fu=cmr10 scaled 100
\font\Fv=cmr10 scaled 101
\font\Fw=cmsl10 scaled 1
\font\Fx=cmsl10 scaled 10000

\leftline{\Fr CMR5 scaled 500 does not exist.}
\leftline{\Fs CMR5 scaled 330 does not exist.}
\leftline{\Ft CMR10 scaled 99 does not exist.}
\leftline{\Fu CMR10 scaled 100 does not exist.}
\leftline{\Fv CMR10 scaled 101 does not exist.}
\leftline{\Fw CMSL10 scaled 1 does not exist.}
\leftline{\Fx CMSL10 scaled 10000 does not exist.}
\vfil\eject

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 14
% This page has a paragraph illustrating most of the characters from the
% standard roman TeX text font.

\message{Standard paragraph.}
\rm
Our task is to create a paragraph illustrating what a typical piece of text
looks like in the standard \TeX\ font.  It should be stressed that not all
\TeX\ fonts can be used for typesetting text.  We need to show most of the
characters in this font---for instance, something like ``the quick brown fox
jumps over a lazy dog'' would use all the lower-case letters.  Hmmm \dots\
how about ``THE QUICK BROWN FOX JUMPS OVER 9876543210 LAZY DOGS'' to make
sure we show all the upper-case letters and digits?  Such a paragraph would
hardly be typical!  Then there's ligatures (try and fit in words like
fluffy, waffle, firefly, difficult) and examples of kerning (boxer, cooked,
vowel).  Not to mention the various accents and other special letters:
prot\'eg\'e, r\^ole, na\"\i ve, \AE sop's \OE vres en fran\c cais.
But how do we put all this stuff into a paragraph that makes sense!?
\vfil\eject

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 15

\message{Page in bottom half of A4 paper.}
\null\vfil
\centerline{Page in bottom half of A4 paper.}
\eject

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 16

\message{Page completely above left of A4 paper.}
\voffset -3in
\hoffset -9in
\leftline{Page completely above left of A4 paper.}
\vfil\eject

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 17

\message{Page completely below right of A4 paper.}
\voffset 3in
\hoffset 9in
\null\vfil
\rightline{Page completely below right of A4 paper.}
\eject

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 18

\message{Page beyond all edges of A4 paper.}
\voffset -3in
\hoffset -3in
\vsize 15in
\hsize 15in
\line{Page beyond all edges of A4 paper.\hfil
      Page beyond all edges of A4 paper.}
\vfil
\line{Page beyond all edges of A4 paper.\hfil
      Page beyond all edges of A4 paper.}
\eject
\voffset 0in \hoffset 0in       % offsets back to normal
\hsize 6.3in \vsize 9in         % page size back to normal

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 19
% This page tests the maxdrift code in DVIReader.

\message{Aligned verbatim tt strings.}
\input verbatim
\begintt
12345678901234567890123456789012345678901234567890123456789012345678901234567890
--------------------------------------------------------------------------------
-                                                                              -
*                                                                              *
********************************************************************************
\endtt
\vfil\eject

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 20
% This page tests a font with a blank character.

\message{Page with blank character.}
\font\cmtex=cmtex10
\leftline{\cmtex a\char32 b}
\vfil\eject

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DVI page 21
% This page tests the use of PostScript fonts.

\message{Page with PostScript fonts.}
\font\TRfive   = ps-times-r at 5pt
\font\TRten    = ps-times-r at 10pt
\font\TRtwenty = ps-times-r at 20pt
\font\TRforty  = ps-times-r at 40pt

\leftline{\rm This is \TRfive   Times-Roman at 5pt.}
\leftline{\rm This is \TRten    Times-Roman at 10pt.}
\leftline{\rm This is \TRtwenty Times-Roman at 20pt.}
\leftline{\rm This is \TRforty  Times-Roman at 40pt.}

\bigskip
\TRten
Our task is to create a paragraph illustrating what a typical piece of text
looks like in the standard Times-Roman font.  It should be stressed that not all
fonts can be used for typesetting text.  We need to show most of the
characters in this font---for instance, something like ``the quick brown fox
jumps over a lazy dog'' would use all the lower-case letters.  Hmmm \dots\
how about ``THE QUICK BROWN FOX JUMPS OVER 9876543210 LAZY DOGS'' to make
sure we show all the upper-case letters and digits?  Such a paragraph would
hardly be typical!  Then there's ligatures (try and fit in words like
fluffy, waffle, firefly, difficult) and examples of kerning (boxer, cooked,
vowel).  Not to mention the various accents and other special letters:
prot\'eg\'e, r\^ole, na\"\i ve, \AE sop's \OE vres en fran\c cais.
But how do we put all this stuff into a paragraph that makes sense!?

\vfil\eject

\bye
