[comp.text.tex] The Level 0 Draft standard

dhosek@sif.claremont.edu (Hosek, Donald A.) (07/22/90)

Below is the Level 0 standard (draft 0.03) which will be in its
final form for publication in the last regular issue of TUGboat
for 1990.

In the last month before the standard is being put in its final
form, the TUG DVI standards committee is soliciting opinions from
the TUG membership. If you have any comments about the
specifications listed below, please send them to
dhosek@ymir.claremont.edu, or, if that does not work,
dhosek@ymir.bitnet.

The appendices referenced are taken more-or-less directly from
the descriptions of the file formats in DVItype, GFtype, PKtype
and TFtoPL. The rounding error appendix will be sent separately.

-----------------------------------------------------------------------

\documentstyle[ltugboat]{article}
\title{A Draft Proposal for the ``Level~0'' {\tt DVI} Driver Standard}
\author{Don Hosek\thanks{On behalf of the TUG {\tt DVI} Driver Standards
   Committee}}

\makeatletter
\newcounter{impnote}
\def\theimpnote{\alph{impnote}}
\def\impnote#1{{\def\@mpfn{impnote}%
  \let\thempfn=\theimpnote
  \footnote{#1}}}
\makeatother

\def\tensl{\sl}

\let\App=\appendix
\def\appendix{\App\small} % tighten up the ending pages of the standard.

\hbadness=9999 % Cut down the amount of annoying messages generated...

% For file format descriptions:
\def\res#1{{\bf #1}}
\def\sty#1{{\it #1}}

\begin{document}
\maketitle

\emergencystretch=\hsize
\divide\emergencystretch by 10 % I think this will encourage 10 words/line


\begin{abstract}
The following represents a minimal standard (level~0) for {\tt
DVI}
drivers. The complete standard will be presented as a series of
``tiers'' requiring increasingly stringent control over the
output of {\tt DVI} drivers. A trip test for {\tt DVI} drivers will be
created which will allow developers of {\tt DVI} drivers to insure that
their drivers meet the standards developed here. The
specifications here should be considered minimal and driver
developers are encouraged to write drivers whose capabilities are
beyond these specifications.

This version of the Level~0 Standard presented here is
draft~0.03. It has been reviewed by the TUG Driver Standards
Committee and is now being presented to the TUG membership at
large for review. This will form one portion of the TUG {\tt DVI}
Driver Standard. 
\end{abstract}

\section{Purpose of the Level~0 standard}

The Level~0 Standard is meant to be a base standard to which all 
drivers should adhere. It is intended to allow all reasonable
applications to be printed on all drivers.

The basis for many of the specifications in this standard is the
possible output of \TeX82; functions which can be implemented via
a pre-processor are generally omitted ({\em e.g.,\/} page
selection and sorting).

Footnotes beginning with a letter are implementation notes and are
hints on handling difficult circumstances for printers.



\section{The {\tt DVI} file}

As a rule, {\tt DVI} drivers should be able to interpret any {\tt
DVI} file which falls within the following limits. These
specifications are a {\em minimum\/}; good drivers will probably
be able to handle {\tt DVI} files exceeding these limits ({\tt
DVI} files which exceed the limits are likely  to be rare, but
might still occur).

\subsection{{\tt DVI} commands}

The driver should be able to interpret every {\tt DVI} command
listed in appendix~\ref{dvi-format}. % See file dvi.tex

\subsection{Characters}
\subsubsection{Number of characters in a {\tt DVI} font}

The driver should be able to handle fonts which have characters
at any code in the range $0\le c<256$.\impnote{Some output devices will
require {\tt DVI} fonts with more than a given number of
characters to be broken into two or more device fonts when
downloaded to the printer.}

\subsubsection[{\tt DVI} character size]{{\tt DVI} character
size\footnote{The values presented here and in the following
sections are preliminary and
subject to modification.}}

The driver should be able to print any character up to a  size of
600pt (horizontal) by 800pt (vertical).\impnote{Note that some
output devices will require breaking down such a character into
smaller  pieces or drawing the character in graphics mode.}

\subsubsection{Number of {\tt DVI} characters per page}

The driver should be able to print a page containing as many as
20,000 {\tt DVI} characters.

\subsubsection{Unusual characters}

The driver should correctly handle (a)~characters with empty
bitmaps ({\em e.g.,\/} the \SliTeX\ fonts) including characters
whose horizontal escapement is~0, (b)~characters whose
printable image is wider than its horizontal escapement, and
(c)~characters with a negative horizontal escapement.

\subsection {Rules}
\subsubsection{Rule size}

The driver should be able to print rules of any size up to 600pt
(horizontal) by 800pt (vertical).

\subsection{Number of rules per page}

The driver should be able to print a page containing as many as
1000~rules.

\subsection{Stack}

The driver should have, as a minimum, a stack depth of 100 for
{\tt DVI} {\it push\/} and {\it pop\/} commands.

\subsection{Positioning on the page}

\subsubsection{Location of the origin}

The point $(0,0)$ in {\tt DVI} co\"{o}rdinates should be located
at a point one inch from the top of the page and one inch from
the left side of the page. 

\subsubsection{Changes in position due to characters and rules}

The driver should accurately track movement using the pixel width
from the font raster file and the {\tt TFM} width from either the
font raster file or {\tt TFM} file with the {\tt TFM} width from
the font raster file taking priority. This is described in
appendix~\ref{rounding-algorithim}.

Positioning of rules is handled similarly with the rounding done
using the algorithim in appendix~\ref{rounding-algorithim}.

The {\tt TFM} format is described in
appendix~\ref{tfm-format}.

\subsubsection{Range of movement}

The driver should be able to handle movements in the {\tt DVI}
file up to a total of $2^{31}$ {\tt DVI} units in any direction
from the  origin.

\subsubsection{Objects off of the page}

Any printable object which would lie entirely off the physical 
page should not be printed but any changes to positioning should
still be taken into consideration. Any printable object which
would lie partially off the physical page should either be
clipped so that portion of the object that lies off the page is
not printed or omitted entirely.

\subsection{Fonts}

\subsubsection{Font numbers}

The driver should be able to accept font numbers (the  parameter
$k$ given by the {\it fnt\_def\/} command) in the range  $0\le
k<256$.

\subsubsection{Distinct {\tt DVI} fonts}

The driver should be able to handle any document containing 64 or fewer
distinct {\tt DVI} fonts.

\subsection{Specials}

The Level~0 Standard requires no support for specials. Specials
not officially defined by the {\tt DVI} driver standards
committee should be flagged with a warning when read from the
{\tt DVI} file. If any specials are ignored by the driver, the
driver must issue a warning message.

\section{Configuration}

It should be possible for the installer of a driver to
configure such things as the location and naming scheme of fonts,
default paper size, etc.\ without having to recompile the driver.

\section{Font files}

\subsection{Font formats}

The driver should be able to read {\tt PK} fonts with the
location specifiable at run time. The {\tt PK}
format is given in appendix~\ref{pk-format}. {\tt GF} support is
optional. The {\tt GF} format is given in
appendix~\ref{gf-format}.

\subsection{The scaling number}

The magnification and resolution of a font are incorporated into
a scaling number of one of two types:
\begin{description}
\item[Magnification number]
The magnification number is given by $5\times {\it resolution}
\times {\it magnification\/}$ where the resolution is given in
dots per inch (on devices with a non-unit aspect ratio, the
horizontal resolution should be used) and a magnification of 1
indicates no magnification. This is an old naming scheme derived
from the old 200~dpi 

\item[Resolution number]
The resolution number is given by ${\it resolution} \times {\it
magnification}$ where both values are as above. This is the
preferred specification for {\tt GF} and {\tt PK} files.
\end{description}

\subsection{Magnifications}

\subsubsection{Minimum set of magnifications}

At the minimum, the driver should be able to load fonts at the
following magnifications of its target resolution: 1.0
(magstep0), 1.095 (magstephalf), 1.2 (magstep1), 1.44 (magstep2),
1.728 (magstep3), 2.074 (magstep4), 2.488 (magstep5), 2.986
(magstep6), 3.583 (magstep7), 4.300 (magstep8), and 5.160
(magstep9). However, driver authors are encouraged to support all
possible magnifications.

\subsubsection{Margin of error}

If a {\tt DVI} file requests a magnification within 2\,\% of a
supported magnification, the driver should use that font without
warning.

\subsection{Missing fonts}

If a font is missing the driver should continue processing and
deal with the missing font in one of three ways:
\begin{enumerate}
\item Insert appropriate white space where the font would
           appear,
\item Insert black rectangles of the size of the font given in
           the {\tt TFM} file,
\item Print the characters from that font at a different size or
           from another font at the same size after issuing a
           warning.
\end{enumerate}
If methods 1 or 2 are used and the driver is unable to locate
size information for the font in question, then the driver may
simply ignore any {\it set\_char\/} or {\it put\_char\/} commands
that occur while the current font is that font.

Under no circumstances should a missing font cause a fatal error.

\appendix

% All appendices ommitted... for this distribution. The complete
% standard can be obtained from ymir.claremont.edu in 
% [anonymous.tex.dvi-standard]
% Mailserv users should send the command
%  SEND [TEX.DVI-STANDARD]00README.TXT
% to find out what files are needed.
%\input{dvi.tex}
%\input{gf.tex}
%\input{pk.tex}
%\input{tfm.tex}
% \input{vf.tex} %Since VF files are not referenced in level 0,
% this is omitted for brevity's sake.
\end{document}


---
Don Hosek                         TeX, LaTeX, and Metafont Consulting and
dhosek@ymir.claremont.edu         production work. Free Estimates.
dhosek@ymir.bitnet                
uunet!jarthur!ymir                Phone: 714-625-0147