% LaTeX input for the "OzTeX System Guide".
% Non-LaTeX cross-references are flagged by "XREF".
% Unfinished or uncertain portions are flagged by "???".

\documentstyle[11pt]{article}

% 1in margins at left and right
\oddsidemargin=0in
\evensidemargin=0in
\textwidth=6.25in              % A4 paper is 8.25in wide

% 1in margins at top and bottom
\headheight=0pt
\headsep=0pt
\topmargin=0in
\textheight=9.7in              % A4 paper is 11.7in high

\input OzTeX                   % \OzTeX logo definition
\input amstexname              % \AmSTeX logo definition

\def\DV{DVIto\kern-.1em VDU}

\font\logo=logo10 at 11pt
\def\mf{{\logo METAFONT}}
\def\texbook{{\sl The \TeX book\/}}
\def\texprog{{\sl \TeX: The Program\/}}
\def\initex{{\tt INITEX}}
\def\WEB{{\tt WEB}}
\def\TANGLE{{\tt TANGLE}}
\def\TFtoPL{{\tt TFtoPL}}
\def\PLtoTF{{\tt PLtoTF}}
\def\PAStoMOD{{\tt PAStoMOD}}

\def\ozdisk{{\tt OzTeX}}
\def\srcdisk{{\tt Sources}}
\def\webdisk{{\tt WEBtoMOD}}
\def\pk#1{{\tt PK-#1}}
\def\ozconfig{{\tt Oz.config}}
\def\configs{{\tt Configs}}
\def\oztext{{\tt Oz.text}}
\def\ozps{{\tt Oz.ps}}
\def\texthdr{{\tt TEXTtoPS.ps}}
\def\dvihdr{{\tt DVItoPS.ps}}
\def\prep{{\tt LaserPrep.ps}}
\def\globalps{{\tt global.ps}}
\def\pkfiles{{\tt PK-files}}
\def\psfiles{{\tt PS-files}}
\def\texfonts{{\tt TeX-fonts}}
\def\texinputs{{\tt TeX-inputs}}
\def\texformats{{\tt TeX-formats}}
\def\helpfiles{{\tt Help-files}}
\def\texdocs{{\tt TeX-docs}}
\def\latexdocs{{\tt LaTeX-docs}}
\def\sedit{$\Sigma$Edit}
\def\dvimac{{\tt DVIM72-Mac}}

\def\Modula{\hbox{Modula-2}}

\begin{document}

\null
\vfil

\begin{center}
\Huge\bf \OzTeX\ System Guide\\ [3mm]
\normalsize\bf
Version 1.3, September 1990\\
\bf
Andrew Trevorrow\\ [3mm]
\rm
1-3-37 5th St., Habsiguda\\
Hyderabad 500007, India
\end{center}

\bigskip
\bigskip

\noindent
This document is aimed at programmers who would like to modify \OzTeX\ or
carry out further development.
It assumes you have a strong background in \TeX\ and programming experience on
the Mac, especially with \Modula\ under MPW (Macintosh Programmer's Workshop).
If you are planning to make changes to \OzTeX\ then please get in touch
so that we can coordinate our efforts.


\tableofcontents

\vfil

\thispagestyle{empty}

\newpage

\section{What you need}

\subsection{\Modula\ and MPW}

\OzTeX\ was developed using TML~\Modula\ v1.10 which runs as a tool
under MPW (version~2 or 3).
TML Systems no longer distribute the \Modula\ compiler, but a much
newer and presumably improved version is now available from Metrowerks:

\bigskip
            
\indent
\vtop{\hbox{(in the United States)}
\hbox{Metrowerks, Inc.}
\hbox{The Trimex Building, Route 11}
\hbox{Mooers, NY 12958}
\hbox{U.S.A.}
\vskip 4pt
\hbox{phone: (514) 458-2018}
}
\indent\indent
\vtop{\hbox{(Canada and international)}
\hbox{Metrowerks, Inc.}
\hbox{548 Main, m/s 95}
\hbox{Hudson Heights, J0P 1J0}
\hbox{Canada}
}

\bigskip

\noindent
MPW is available through APDA
(AAPDA in Australia or ADG in the UK)\null.
It's worth very cent.
I've found it to be the best programming environment I've come across.

\subsection{Contents of \srcdisk\ disk}

All the source code for \OzTeX\ is packed into a StuffIt archive on the
\srcdisk\ disk.  It contains the following files and folders:
\begin{description}

\item[\tt Build-OzTeX] \leavevmode\null \\
This is the MPW worksheet used to build \OzTeX\ and carry out other
miscellaneous tasks.
All the MPW commands for compiling resources, compiling source modules
and linking the final application are kept in this file.

\item[\tt Sources] \leavevmode\null \\
This folder contains Modula-2 definition modules (\verb|*.DEF| files),
their matching implementation modules (\verb|*.MOD| files),
and various Rez input files (\verb|*.r|).

\item[\tt Symbols] \leavevmode\null \\
An empty folder.
\verb|Build-OzTeX| uses this folder to store all the \verb|*.SBM| files
created by compiling \verb|*.DEF| files.

\item[\tt TeX-sources] \leavevmode\null \\
This folder contains all the \TeX-related modules
(\verb|TeX*.DEF| and \verb|TeX*.MOD| files).

\item[\tt TeX-objects] \leavevmode\null \\
An empty folder.
\verb|Build-OzTeX| uses this folder to store all the \verb|TeX*.MOD.o| files
created by compiling \verb|TeX*.MOD| files.
This scheme simplifies the MPW \verb|link| command.

\item[\tt Objects] \leavevmode\null \\
An empty folder.
\verb|Build-OzTeX| uses this folder to store all other \verb|*.MOD.o| files.

\item[\tt Trip] \leavevmode\null \\
This folder contains the files used to carry out Knuth's torture test
for \TeX~3.0.

\end{description}

\subsection{Contents of \webdisk\ disk}

The \webdisk\ disk has a StuffIt archive containing
all the MPW tools and scripts used to convert
version 3.0 of \verb|tex.web| into Modula-2.
\verb|tex.web| itself is not included; at over 1MB in size I decided
it was too big to add to the \OzTeX\ distribution.
\TeX\ hackers please note: the latest versions of
\TANGLE, \TFtoPL\ and \PLtoTF\ are included as MPW tools.


\section{Translation of \TeX\ into \Modula}

The translation of the \WEB\ source for \TeX~3.0 into \Modula\ for the
Macintosh has been redone from scratch.
The resulting code is much nicer to look at and far easier to modify
than the \TeX\ code used in previous versions of \OzTeX\null.
The main reason for the improvement is that nearly all the
\WEB\ numeric macros have been changed to symbolic constants.

The \verb|Build-TeX| file in the \webdisk\ disk contains the MPW commands
used to translate \verb|tex.web| into a set of \Modula\ source files.
Here is a brief summary of the translation process:
\begin{enumerate}

\item
Before I could start on \TeX\ I had to get version 4 of \TANGLE\ working.
The starting point was \verb|tangle.web| and an implementation of
\TANGLE\ version 3 by Wayne Sewell
(much thanks to Walter Carlip for sending me all this stuff).
I also had to write \PAStoMOD, a Pascal-to-Modula-2 converter.
The steps required to create \TANGLE\ provided a useful preparation
for the much harder task of translating \TeX.

\item
A special-purpose change file, \verb|tex.ch|, was created.
This was \TANGLE d with \verb|tex.web| to produce \verb|tex.pas|.

\item
\verb|tex.pas| was passed through \PAStoMOD\ to create \verb|tex.mod|.

\item
The output of \PAStoMOD\ is a nicely formatted \Modula\ program, but
with quite a few syntax errors.  It was easier to fix these problems
using the pattern matching facilities in MPW, so an
MPW script called \verb|FixTeX| was created to fix \verb|tex.mod|.

\item
\verb|tex.mod| was then decomposed by \verb|SplitTeX|
into a number of smaller modules suitable for separate compilation.
The resulting files were stored in a sub-folder called \verb|TeX-sources|.

\item
After tracking down a few bugs, the final outcome was an MPW tool version
of \TeX\ that passed Knuth's trip test.

\end{enumerate}
The resulting code was then merged into \OzTeX\ and many more changes made.
These changes were {\em not\/} recorded in MPW scripts, mainly because this
is a very boring way of writing code (and I got lazy).
It would be easy to
reproduce the changes by repeating the above steps    % XREF
and then running \verb|compare| on all the files in the
two different \verb|TeX-sources| folders.

Until major changes are again made to \TeX,
I'd advise anybody wanting to modify the \TeX\ part of \OzTeX\ to
forget the \webdisk\ disk and go straight to the \verb|TeX-sources| folder
on the \srcdisk\ disk.
And get the latest printing of \texprog.


\section{An overview of the code}

\OzTeX\ is essentially the merging of three programs:
\TeX, PSPRINT and \DV\null.
The latter two are public domain programs I wrote while
working at Adelaide University and are available for VAX/VMS and UNIX systems.
Both programs come with System Guides that might provide
a useful introduction to the inner workings of \OzTeX\null.
There have been significant changes though, most of them improvements!

Here is a brief description of each \OzTeX\ module in top-down order.
I'll concentrate on the main purpose of each module and occasionally mention
the most significant routines and data structures:
\begin{description}

\item[\tt OzTeX.MOD] \leavevmode\null \\
The main module; note that there is no corresponding \verb|.DEF| file.
It handles most of the high-level, Macintosh-specific aspects of
\OzTeX's user interface.
The key routine is \verb|MainEventLoop|; this is the best place to
start tracing exactly what \OzTeX\ will do in response to most
user-initiated events.

\item[\tt TeX.DEF/MOD] \leavevmode\null \\
\OzTeX's interface to \TeX\null.
\verb|OzTeX.MOD| uses just two routines: \verb|RunTeX| and \verb|UnloadTeXSegs|.

\item[\tt TeX*.DEF/MOD] \leavevmode\null \\
All the \TeX-related modules.
They are used only by \verb|TeX.MOD| and other \TeX-related modules.
When modifying and testing parts of \OzTeX\ that have nothing to do
with \TeX, you can speed up linking considerably by commenting out
all references to the \TeX-related modules --- see the \verb|link| command in
\verb|Build-OzTeX|.   % XREF

\item[\tt DVItoPS.DEF/MOD] \leavevmode\null \\
Used by \verb|OzTeX.MOD| to translate a DVI file into PostScript.
The important routines are \verb|TranslateDVIFile| and \verb|DoPage|.
Much of the code is based on PSPRINT 3.0.

\item[\tt DVItoMac.DEF/MOD] \leavevmode\null \\
Used by \verb|OzTeX.MOD| to preview a DVI file.
The important routines are \verb|ViewDVIFile|, \verb|ProcessPage|
and \verb|DisplayPage|.
Some of the code is based on \DV\ 3.0.

\item[\tt DVIReader.DEF/MOD] \leavevmode\null \\
Used by \verb|DVItoPS.MOD| and \verb|DVItoMac.MOD|
to read and interpret DVI files.
The definition module exports most of the critical data structures,
such as the various lists containing information about all the
fonts, characters, rules and \verb|\special|s appearing on a DVI page.

\item[\tt FontReader.DEF/MOD] \leavevmode\null \\
Used by \verb|DVItoPS.MOD| and \verb|DVItoMac.MOD|
to read and interpret TFM and PK files.

\item[\tt PStoPrinter.DEF/MOD] \leavevmode\null \\
Used by \verb|DVItoPS.MOD| and \verb|OzTeX.MOD|
to send PostScript code to the current printer.
Note that the implementation module uses low-level PAP code (rather than
Print Manager routines) to communicate with the printer;
this gives us complete control over what gets sent to the printer and
any messages that come back (such as PostScript errors).

\item[\tt Options.DEF/MOD] \leavevmode\null \\
Reads configuration files and exports various global parameters.

\item[\tt FileIO.DEF/MOD] \leavevmode\null \\
Handles all text file input/output.

\item[\tt TermIO.DEF/MOD] \leavevmode\null \\
Provides \OzTeX\ with a terminal-like window, mostly for output.
The reading routines are only used in a few \TeX-related modules.

\item[\tt LowLevel.DEF/MOD] \leavevmode\null \\
The lowest-level module.
It exports routines used by nearly all the above modules to handle
errors and carry out other miscellaneous tasks.
The implementation block is the first piece of \OzTeX\ code executed
and does a number of important things:
\begin{itemize}
\item
Checks that we are running on a 128K ROM Mac or newer model.
\item
Checks that the Hierarchical File System is running.
\item
Installs the VBL task used to detect Command-C/Dot interrupts.
\item
Installs the \verb|FatalGrowZone| function used to trap out-of-memory errors.
\item
Initializes a number of global parameters and procedure variables.
\end{itemize}

\end{description}

\newpage


\section{History of changes}

\OzTeX\ 1.0 was released in April, 1989.

\subsection{Changes to version 1.0}

\begin{itemize}
\item
Added \verb|Changes| to the Help menu.

\item
Added support for MultiFinder.
This included adding a SIZE~$-1$ resource,
adding code to handle Suspend and Resume events in \OzTeX's main event loop,
and changing the implementation of \verb|OpenIn| in \verb|FileIO.MOD|
so that a text file currently open by another application (such as an editor)
could also be opened by \OzTeX.

\item
Fixed bug that prevented \OzTeX\ reading or writing files on other disks.
[Reported by Chris Meaney.]

\item
Fixed bug that caused a spectacular crash if \OzTeX\ couldn't open the current
printer resource file.
[Reported by Chris Meaney.]

\item
Certain fatal errors (``not enough memory'' or ``disk full'') no longer
leave files open.

\item
Added a new ``Include Laser Prep'' check box option to the print dialogue.
This simplifies the inclusion of a modified Laser Prep when printing a DVI
file that uses \verb|\special|s to include Mac-generated PostScript files.
If this option is selected then \OzTeX\ appends \prep\ to \dvihdr.
The option's default setting has been added to \ozconfig.

\item
The names of \OzTeX's special folders and files are now defined in \ozconfig\
rather than in STR resources.
[Suggested by Leigh Hume.]

\item
Modified \verb|DVItoPS.MOD| so that the PostScript output
generated by \OzTeX\ starts with \dvihdr.
This and other PostScript files now begin with ``\verb|%!|'' as recommended
in Appendix C of Adobe's {\sl PostScript Language Reference Manual}.
[Suggested by Nick Nei.]

\item
Added MENU resources to the \OzTeX\ application so people can use a resource
editor to change the Command-key equivalents to suit themselves.
Note that I changed the location of Command-P, Command-T and Command-W.

\item
Shift-Command-W will bypass the view dialogue box and display the most
recently viewed DVI page (or page 1 if used first time).
[Suggested by Leigh Hume.]

\item
You can now print or preview an \OzTeX\ DVI file from the Finder.
Use ``Print'' in the Finder's File menu to print a selected DVI file
or ``Open'' (or double-click) to preview it.
[Suggested by Leigh Hume.]

\item
\verb|SystemTask| is called once every DVI page when typesetting or printing
so that DAs get a chance to execute.
[Suggested by Leigh Hume.]

\item
Modified \texthdr\ so that Macintosh characters (like $\Sigma$) print correctly.

\item
Updated the \OzTeX\ User Guide and completed the \OzTeX\ System Guide.

\end{itemize}
\OzTeX\ 1.1 was released in June, 1989.


\subsection{Changes to version 1.1}

\begin{itemize}

\item
If the view window is frontmost then the cursor is changed to a cross
whenever it moves over the contents region.  The current position of the
cross is shown (in paper coordinates) in a box at the lower left corner
of the view window.  Users can click in this box to change units.

\item
\OzTeX\ will now look for PK file names of the form
\verb|:PK-files:300:cmr10.300pk|
after first looking for \verb|:PK-files:300:cmr10|.
This makes it easy for people
to Kermit down their own PK files without the need to do any renaming.
[Suggested by Sam Gassel.]

\item
Some of \TeX's capacity parameters are now specified in \ozconfig.

\item
PostScript text fonts can now be previewed correctly by specifying the
encoding scheme for the corresponding screen fonts in \ozconfig.

\item
The location and size of \OzTeX's windows are now saved upon quitting
(and used the next time \OzTeX\ starts up).

\item
\TeX\ can now input 8-bit characters.  This allows \TeX\ input files to be
much more readable for people that don't use English.
[Suggested by J\"orgen Pind and Martti Nikunen.]

\item
Nearly all the files in \texinputs\ have been updated.
The format files in \texformats\ have been rebuilt.

\item
A Times-\LaTeX\ format has been provided for people that prefer to use
PostScript text fonts instead of Computer Modern.
See the \verb|Times-*.*| files in \texinputs.      % XREF

\item
The \verb|@newfont| procedure in \dvihdr\ is now passed the maximum
character code in the PK font.
People no longer have to edit the \verb|@newfont| code to be able
to use PK fonts with more than 128 characters.

\item
When printing a DVI file, \OzTeX\ will look for a file called \globalps\ in
the current folder and include its contents at the end of the PostScript
prologue.

\item
A number of modified versions of Laser Prep are supplied in \psfiles\ in case
the default file specified in \ozconfig\ doesn't work with the PostScript code
generated by a particular Mac.

\item
Any \verb|\special|s on a page are now processed in the order they appear in the
DVI file (instead of in reverse order).

\item
A Help file is displayed much more quickly and with its top line showing.

\item
\verb|ErrHandler.DEF/MOD| renamed to \verb|LowLevel.DEF/MOD|.

\item
After switching back to \OzTeX\ from MultiFinder we now make sure the cursor
is reset to the normal arrow pointer.

\item
Modified \texthdr\ so that Macintosh characters (like \c c) print correctly.

\item
No longer display the ``\verb|Loading format file...|'' message
when running \TeX.

\item
The \OzTeX\ application now has FOND and FONT resources for 9\,pt Monaco to
avoid relying on the resources in the System file
(which may have been modified).
[Problem reported by Larry Siebenmann.]

\item
\OzTeX\ now looks for the printer resource file only in the System folder of
the startup disk.  It no longer relies on the ``poor man's search path''.
[Problem reported by Bharat Jayaraman.]

\item
Renamed {\tt fmt} files so they match exactly the case of the
names used in \ozconfig.  This avoids problems with a UNIX-based file-server.
[Suggested by John Zic.]

\item
Created \verb|psnames.tex| in \texinputs\ for people that use PostScript fonts
and want to be able to run the same \TeX\ input file on a variety of systems
even if they have different naming conventions for PostScript TFM files. 
See \verb|psfonts.tex| in \texdocs\ for how to use \verb|psnames.tex|.   % XREF

\item
Added Bob Campbell's Modula-2 compiler to the \OzTeX\ package.
To squeeze everything into ten 800K disks I used Raymond Lau's excellent
StuffIt utility.

\item
\OzTeX\ 1.2 is built using MPW 3.0.  If you still have MPW 2.x then the only
change you'll need to make is to \verb|:Sources:SIZE.r|.
See the comments there.   % XREF

\end{itemize}
\OzTeX\ 1.2 was released in October, 1989.


\subsection{Changes to version 1.2}

\begin{itemize}

\item
Implemented \TeX\ 3.0.  (Actually, a couple of bugs have been fixed,
so the correct version is probably more like 3.02.)
Typesetting is about 5\% faster.

\item
Since \TeX\ 3.0 allows input of 8-bit characters, there is no need for
the STR\#~201 resource.
\verb|8bit.tex| in \texdocs\ has been updated to use
\verb|8bitdefs.tex|, a new file in \texinputs.

\item
There is a new Config menu to support rapid switching between multiple
configuration files.
\ozconfig\ has been replaced by \verb|Default| which is kept in the
\configs\ folder along with other configuration files.

\item
To help keep non-default configuration files short and simple, a couple of
special characters (\verb|?| and \verb|!|) can be used.
See the example files in the \configs\ folder.   % XREF

\item
Instead of a single resolution parameter in the configuration file there
are now two: one for printing a DVI file and the other for previewing.

\item
The horizontal and vertical offsets specified in the configuration file
no longer affect the positioning of pages when previewing a DVI file.

\item
Some of the special files defined in the configuration file are no longer
assumed to reside in certain folders; their locations must be specified.

\item
People with colour monitors can now see coloured paper edges,
\verb|\special| markers and missing fonts when previewing a DVI file.
The colours are specified in the configuration file.

\item
There is no longer a STR\#~200 resource stored in the \OzTeX\ application.
\initex\ now reads pool strings from a text file; its name and
location are specified in the configuration file.

\item
More of \TeX's important parameters are specified in the configuration file.
The format files supplied with \OzTeX\ have all been rebuilt with the
parameter settings in the \verb|Default| configuration file.

\item
To help people choose \TeX\ parameter values that suit their Mac's memory,
the amount of memory allocated is now displayed at the end of a \TeX\ session.
The elapsed time is also displayed.

\item
For compatibility with older versions of \TeX\ and \LaTeX, the following lines
have been added to \verb|plain.tex| and \verb|lplain.tex|:

\smallskip

\indent\verb|   \lefthyphenmin=2|\\
\indent\verb|   \righthyphenmin=3|\\
\indent\verb|   \errorcontextlines=5|

\item
Menus that contain items obtained from the configuration file now appear correct
if given a string that contains meta-characters (like \verb|/|) or is empty
(the item will be ``NUL'').

\item
Previous versions of \OzTeX\ could lose track of the current folder under
certain situations.  You could run \initex\ and it would find a given file
in the current folder, but if you then ran a DA or switched to another
application under Multifinder and ran \initex\ again it would fail to find
the file even though the current folder had not apparently changed.
This problem has been fixed.

\item
Viewing a DVI file on a colour monitor is now faster, especially on
a large screen.  \OzTeX\ used to save an off-screen copy of any new view so
that a later update could be done rapidly.  On a large colour monitor the
copying step caused an uncomfortable delay.  Since updating occurs less
often than changing the view, the copying step is no longer done.

\item
A silly bug in \dvihdr\ has been fixed (it could cause a \verb|rangecheck|
error on non-LaserWriter printers).

\item
A return is added at the end of an included \verb|\special| file to avoid
the possibility of a PostScript error.

\item
The way \OzTeX\ checks for out-of-memory errors has been improved.
Most \verb|NewPtr| calls are bracketed by code that disables and enables
the fatal grow-zone function installed by \verb|LowLevel.MOD|.

\item
Ignored a pair of inactive/active events after ``About \OzTeX'' that caused
scroll bars to flash unnecessarily.

\item
The way \OzTeX\ searches for TFM and PK files has been extended.
See \verb|Changes| in the \helpfiles\ folder for details.         % XREF

\item
A DVI file is now opened for shared reading.  This allows two copies of
\OzTeX\ under MultiFinder to open the same DVI file and view side-by-side pages.
(A clumsy way of doing it, but better than nothing.)

\item
The maximum line length in the \OzTeX\ window now has a minimum value of 256,
so the output of ``Show Config'' is unlikely to be auto-wrapped.
When typing input to \TeX\ the cursor will no longer move beyond the current
right hand edge of the \OzTeX\ window.

\item
\AmSTeX\ is no longer distributed with \OzTeX\ as the version I have is way
out of date.

\item
James Walker's \dvimac\ program is distributed with \OzTeX.

\item
The Modula-2 compiler is no longer distributed as the
author has withdrawn permission.
The rights to the compiler have been taken over by Metrowerks.
The disk with the Modula-2 compiler has been replaced by the \webdisk\ disk.

\end{itemize}
\OzTeX\ 1.3 was released in September, 1990.


\section{Future development}

Here is a list of what I think are the most important areas
for future development of \OzTeX:
\begin{itemize}

\item
Provide a big version of \TeX\ that allows \verb|mem_max| to exceed 64K\null.
The key step is to redefine a halfword to be of type LONGCARD and
examine all the implications of such a change.
Given Modula-2's strict type checking,
it doesn't seem possible to make it a run-time option set in the
configuration file.

\item
Add support for virtual fonts (see Knuth's article in TUGboat~11, no.~1).
Most of the changes would be restricted to \verb|DVIReader.MOD|
and perhaps \verb|FontReader.MOD|.  A list of virtual fonts may need to
be specified in the configuration file.

\item
Support other types of printers, especially the ImageWriter.
(Note that James Walker's \dvimac\ program can't print \verb|\special|s.)
The obvious approach would be to create a new module based on
\verb|DVItoMac.MOD| and add the necessary Print Manager calls to print
page bitmaps.  (If PK files at the correct resolution aren't found,
would scaled 300\,dpi characters look good enough?)

\item
Add support for inclusion of PICT/PNTG/EPSF files in \verb|\special| commands:

\smallskip

\indent\verb|   \special{pict: foo.pict}   |(PICT format)\\
\indent\verb|   \special{pntg: foo.paint}  |(MacPaint format)\\
\indent\verb|   \special{epsf: foo.eps}    |(encapsulated PostScript)\\
\indent\verb|   \special{ps:   foo.ps}     |(raw PostScript)

\smallskip

\noindent
For upward compatibility with existing \verb|\special|s, ``\verb|ps:|'' is
assumed if no keyword is present (note that Mac file names can't end in a colon).
The PICT resource in an encapsulated PostScript file could be
used when previewing a DVI file.
For PICT/PNTG files, printing could be done by drawing into an
off-screen bitmap (or PixelMap at printer resolution?)
and then converting to PostScript code using \verb|imagemask| and hex data.

\item
When translating a DVI file, perhaps \OzTeX's PostScript output should
optionally conform to the structuring conventions defined in Appendix C
of Adobe's {\sl PostScript Language Reference Manual}.
\OzTeX's output is currently nonconforming, and deliberately so, as it aims
to generate highly efficient, compact PostScript code.
A conforming PostScript program must have pages that are independent entities,
but \OzTeX\ sends the bitmap data for a PK character only {\em once per
document}, just before the page that first uses it.
For this scheme to work the bitmap data must be sent outside any
\verb|save|/\verb|restore| brackets surrounding each page.
(This is not done when the ``conserve VM'' option is selected, so perhaps
we should change this option to ``generate conforming PS'' and use a 
different prologue with the required structuring comments.)

\item
Allow previewing of more than one DVI page at a time
by (optionally) creating a new view window for each page.
Add a ``Tile Pages'' item to the View menu?
Significant changes to the data structures in
\verb|DVIReader.DEF| would be needed --- perhaps the lists of
rules/chars/\verb|\special|s for a page should be moved into the \verb|pagetable|.
Can we avoid having to close an open DVI file before printing it?

\item
Specify in the configuration file the point size of the font to be
used for all text in the \OzTeX\ window.  If we also specify the type of font
then major changes to \verb|TermIO.MOD| would be needed, since we could no
longer assume a fixed-width font.

\end{itemize}


\def\nextbook{\vskip 4pt \noindent}

\section{Further reading}

{\sl PostScript Language Reference Manual}, by Adobe Systems Inc.

\nextbook
{\sl PostScript Language Program Design}, by Adobe Systems Inc.

\nextbook
{\sl Macintosh Programmer's Workshop documentation}, by Apple Computer Inc.

\nextbook
{\sl \TeX: The Program}, by Donald E. Knuth.

\nextbook
{\sl A Test file for \TeX}, by Donald E. Knuth.

\nextbook
{\sl \DV: A \TeX\ Page Previewer}, by Andrew Trevorrow.
TUGboat 7, no.~1.

\nextbook
{\sl \DV\ 1.7 and PSPRINT 1.1}, by Andrew Trevorrow.
TUGboat 8, no.~1.

\nextbook
{\sl \DV\ 3.0 and PSPRINT 3.0}, by Peter Abbott \& Andrew Trevorrow.
TUGboat 9, no.~3.

\nextbook
{\sl Programming in Modula-2 (3rd ed.)}, by Niklaus Wirth.

\end{document}
