\magnification=\magstep1
\input nice
\def\mynum#1{\ifnum #1<10 0\the#1\else \the#1\fi}
\def\mymonth#1{\ifcase#1 \or January \or February \or March \or April
   \or May \or June \or July \or August
   \or September \or October
   \or November \or December \fi}
\def\fonttab#1#2{
 $$\vbox{\halign{\strut\vrule\vrule##&\hskip 4pt##&  % Quality
   \vrule##&\hskip 4pt\hfil##\hfil&  % mag0
   \vrule##&\hskip 4pt\hfil##\hfil&  % mag0.5
   \vrule##&\hskip 4pt\hfil##\hfil&  % mag1
   \vrule##&\hskip 4pt\hfil##\hfil&  % mag1.5
   \vrule##&\hskip 4pt\hfil##\hfil&  % mag2
   \vrule##&\hskip 4pt\hfil##\hfil&  % mag2.5
   \vrule##&\hskip 4pt\hfil##\hfil&  % mag3
   \vrule##&\hskip 4pt\hfil##\hfil&  % mag4
   \vrule##&\hskip 4pt\hfil##\hfil&  % mag5
   \vrule\vrule##\cr
  \noalign{\hrule}
  \noalign{\hrule}
  & Quality && mag 0 && mag 0.5 && mag 1 && mag 1.5 &&
  mag 2 && mag 2.5 && mag 3 && mag 4 && mag 5 & \cr
  \noalign{\hrule}
  #1
  \noalign{\hrule}
  \noalign{\hrule}
 }}$$
 \centerline{\bf Flib's for the #2-driver} \vskip 3pt
}

\def \DVIprint {DVIprint}
\def \ShowDVI {ShowDVI}

\def\tbw {\hskip 10pt \it to be written $\ldots$}

\article
\contentslevel=3
\contfill={\dotfill}
\contskip=7pt
\let\scstyle=\bf

\titlepage
\vskip 1in
\title{\DVIprint{}, the \TeX printerdriver}
\removelastskip
\smallskip
\title{for the AMIGA}
\bigskip
\release{Version 1.06}
\smallskip
\release{of}
\release {\mynum{\day}. \mymonth{\month}\mynum{\year}}
\bigskip
\author{by}
\author{Georg He\ss{}mann}
\author{translation by Thomas Tavoly}
\vfill
\abstract{
  \DVIprint{} is a TeX printerdriver for three different printer
  types. It supports the NEC P6/P7, the HP DeskJet, as well as
  the Epson FX 80. Furthermore printing speed and flexible font
  managament are excelling. Plus there is the possibility, to
  print pages in landscape format or to store them in an IFF file.
  And the driver can handle fonts, which have more than 128 characters,
  as well.
}
\vskip 1.2in
\endtitlepage



\medskip
\plainsection{Table of contents:}
\medskip
\makecontents
%%\newpage

\section{Copyright and similar}

The program \DVIprint{} is ``freely distributable copyrighted software''.
That means, anyone can copy and use it. The Copyright however
is fully retained by me.

The program can not be commercially sold without my explicit prior
consent. If distributed as PD software, the price must be below 5 DM (=3 US\$)
per disk or be exactly that amount.

Further distribution is only allowed in a complete and unaltered state.

For further explanation see the README file.

\section{About \DVIprint{}}
\DVIprint{} is a \TeX printerdriver.
As \TeX{} produces only a DVI\footnote{device independent} file as the
single output, you need your own programs, to display the result
on screen on one hand, and on the other, to be able print it.
To this end, the DVI file has to be interpreted and a bitmap
of every single page has to be produced. As in the DVI file only
the information present of where what characters should be - but not
what they look like - you can display a page of a DVI file in any
particular resolution. The only thing that you need for this are the
fonts in the particular resolutions.

As a speciality, \DVIprint{} is not only a printerdriver for a single
printer, but also for more at the same time.
It is capable of driving the NEC P6/P7, the HP-DeskJets, the
Epson FX 80 and compatible printers correctly.

As the printer dependant part of the program is relatively short,
it seems to be economic, to combine several drivers in one program.
For the \DVIprint{} program a C-module is also part of the distribution,
in which the printer dependant parts are present, joined together.
Should you have a printer which is not compatible to one of
the printers supported by the program, then you can make the
necessary alterations in the C-file and send it to me. Then I
will incorporate it into the program.

\section{Calling from the CLI}
In the present version of \DVIprint{} the program can only be
called from the CLI.
However it can be controlled very easily from there:

\hskip 1cm{\tt usage: dviprint [-?] [-a {\it fontarea}] [-b {\it bytes}] [-m {\it bytes}] [-f {\it page}]}
\parwithoutskip
\hskip 3cm{\tt                 [-t {\it page}] [-z {\it dpi}] [-o \{0$|$1$|$2$|$3\}] [-d \{1$|$2$|$3$|$4$|$5$|$6$|$7\}]}
\parwithoutskip
\hskip 3cm{\tt                 [-u] [-g] [-i] [-x] [-r] [-p] [-q] [-e {\it bytes}]}
\parwithoutskip
\hskip 3cm{\tt                 [-l] [-s] [-h {\it offset}] [-v {\it offset}] \it dvifile}
\parwithoutskip
\hskip 5cm and offset = real number{\tt $\{$pt$|$pc$|$in$|$bp$|$cm$|$mm$|$dd$|$cc$\}$}

\staggered{\tt -d \{1$|$2$|$3$|$4$|$5$|$6$|$7\} }
\key{\tt -?} Shows a short explanation of the options, without starting
 the program. The default values are shown too.
\key{\tt -a \it fontarea} Appends {\it fontarea} as additional directory
 in the search path of the fontlibraries. More on this in chapter 7.2
 of the \ShowDVI{} manual.
\key{\tt -b \it bytes} Size of the memory space, in which the loaded fonts
 are kept. The unit used is byte. The default value can be asked with
 the {\tt -?} option.
\key{\tt -m \it bytes} Maximum size of the allocated page-bitmap. Size 0 disables
 this feature.
\key{\tt -f \it page} Start the printing at page {\it page}.
\key{\tt -t \it page} Last page to be printed.
\key{\tt -z \it dpi} Overwrites the dpi resolution.
\key{\tt -o \{0$|$1$|$2$|$3\}} Choice of print quality. The best quality
 can be achieved with 'zero' (default). With 'one' the draft quality is chosen.
 'Two' and 'three' are of importance to HP-Deskjet owners.
 They are meant to conserve ink. To this end only every second line is
 printed. Otherwise 'two' corresponds with letter quality and 'three' with
 the draft mode.
\key{\tt -d \{1$|$2$|$3$|$4$|$5$|$6$|$7\}} Choice of printer type. 'One' and
 'two' switch on the NEC-P6/P7 mode. At option two the optimization is
 smaller, but is better fitting for some NEC-P6/P7 compatibles.
 'Three' and 'four' are both for the HP-DeskJet.
 They differ in that in mode three no optimization is done, and that
 in mode two the volume of the produced data is considerably larger.
 Normally mode two is preferred. The options 'four', 'five', 'six' and
 'seven' are for the Epson compatible 9-pin printers. These differ
 in that 'six' and 'seven' of the printerdrivers do not produce
 {\tt ESC-\$}-command sequences, as there are printers, that do
 not understand this command.
 At 6 (white)spaces are still skipped with 'spaces'.
\key{\tt -u} With this switch you can choose between printing
 bidirectionally or only unidirectionally.
 Zero corresponds to unidirectional and one to bidirectional.
\key{\tt -g} This option activates the ``Landscape'' mode.
 That is, the page is printed rotated over 90 degrees.
 This mode however functions unfortunately only on printers with the
 same horizontal and vertical resolution, i.e. with
 the HP-Deskjet and the NEC-P6/P7 printers.
 Mind you, this mode requires the entire bitmap of a page to be in the
 memory all at once. This therefore requires a well expanded
 memory. 
\key{\tt -i} This option prevents the normal output on the printer.
 Instead, one page at a time is written to an IFF-file.
 The IFF-file is created in the current working directory under the name
 {\it $<$dvi-File$>$\tt .p\it$<$page number$>$}.
 Similarly to the Landscape function, an entire page has to
 fit in the memory here too.
 For this function, the ``iff.library'' of Christian A. Weber
 is needed.
\key{\tt -x} When set, a form feed will not be given after the last
 page has been printed. This then useful, when you want to print
 smaller things like disk stickers or similar.
\key{\tt -r} Prints the pages in reversed order.
\key{\tt -p} Loads all fonts, which are used in the document, already at
 the start of the program in the internal font memory.
\key{\tt -q} Suppresses output of the current page number.
\key{\tt -e \it bytes} Size of the internal printer buffer. As two of
 those are needed, the program uses twice the amount you specify for
 these buffers.
\key{\tt -l} Prevents creation of a logfile.
\key{\tt -s} Outputs additional information in the logfile.
 See also chapter 8 of the \ShowDVI{} manual.
\key{\tt -h \it rxx} Sets the horizontal offset to {\it r}. {\it xx} is here
 the unit.
 Following units can be chosen from:
 \staggered{\qquad\tt mm }
 \key{\qquad\tt pt} point (is used by \TeX{})
 \key{\qquad\tt pc} pica $1 pc = 12 pt$
 \key{\qquad\tt in} inch $1 in = 72.27 pt$
 \key{\qquad\tt bp} big point $72 bp = 1 in$
 \key{\qquad\tt cm} centimeter
 \key{\qquad\tt mm} millimeter
 \key{\qquad\tt dd} did\^ot point $1157 dd = 1238 pt$
 \key{\qquad\tt cc} cicero $1cc = 12dd$
 \endstaggered
\key{\tt -v \it rxx} Sets the vertical offset to {\it r}. {\it xx} is
 a unit as with the {\tt -h} option.
\key{\it dvifile} The DVI file that is to be printed.
\endstaggered

\section{Fonts required}
 Which fonts resp. which resolutions do the particular printerdrivers
 need? Only the fontlibraries are considered here. Of course, you can
 keep the same fonts apart on your harddisk too.

\subsection{For the NEC P6/P7}
 The NEC-P6/P7 driver needs the following libraries:
 \fonttab{
  & Draft&& 180&& 197&& 216&& 237&& 259&& 284&& 311&& 373&& 448&\cr
  \noalign{\hrule}
  & High-Q&& 360&& 394&& 432&& 473&& 518&& 568&& 622&& 746&& 896&\cr
  }{NEC-P6/P7}
 The above are given in {\it DPI}\footnote{Dots Per Inch}. Here,
 180 means, that a library with the name PK0180 must/should exist.

 The libraries of the magnifications {\it magstep 1.5} and
 {\it magstep 2.5} are not necesseraly needed, but every now
 and then, these magnification steps occur.

\subsection{For the HP-DeskJet}
 These libraries are needed by the HP-DeskJet driver.
 Of interest is the fact that for the draft mode the same
 libraries are used as for the screen driver.
 \fonttab{
  & Draft&& 100&& 110&& 120&& 131&& 144&& 158&& 173&& 207&& 249&\cr
  \noalign{\hrule}
  & High-Q&& 300&& 329&& 360&& 394&& 432&& 473&& 518&& 622&& 746&\cr
  }{HP-DeskJet}

\subsection{For the Epson FX-80}
 The libraries, used by the Epson FX-80, have a special trait:
 They are not quadratic in their resolution. The smallest
 fontlibrary of the draft resolution has 120dpi horizontally
 and 72dpi vertically.
 In the Letter Quality resolution, the proportions are 240dpi
 horizontally as opposed to 216dpi vertically.
 \fonttab{
  & Draft&& 120&& 131&& 144&& 158&& 173&& 189&& 207&& 249&& 299&\cr
  \noalign{\hrule}
  & High-Q&& 240&& 263&& 288&& 315&& 346&& 379&& 415&& 498&& 597&\cr
  }{Epson FX-80}

 Because of this asymmetry and the fact, that the
 draft resolution is sufficient for the screen resolution,
 the problem rears its head, that fontlibraries exist, which,
 although they have the same name, have an entirely different
 structure. These are e.g. for a screen resolution of 100dpi
 for example the libraries PK0120, PK0131, PK0144, PK0158,
 PK0173, PK0207 and PK0249. For a different resolution used
 for the previewer, other overlaps occur. This problem can be
 solved quickly and efficiently with the fontdefinition file,
 as there is one for the previewer and the printer driver each.
 You copy the libraries which exist twice to some directory and
 change the configuration file accordingly. As libraries, which
 are defined there, are first searched on the given spot, the
 previewer libraries are not used in the {\tt TeX:fontlib} directory.

 You can also solve this problem, in that you rename all fonts and
 include the horizontal and vertical resolution in the font- library-
 name. For that purpose the modifiers ``\%h'' and ``\%v'' exist,
 as well as ``\%x'' and ``\%y''. Thus you can define the format strings
 in the following manner:

 $$\vbox{
 \halign {#\quad&#\quad&#\quad&#\quad&#\qquad\hfil\cr
 flib\_str &&PK\%04hx\%04v  &&; format string for flib's\cr
 pk\_str  &&\%hx\%v/\%s.\%dpk  &&; format string for PK-files\cr
 }}$$

 With this the font {\tt cmr10} of size {\tt magstep1} at a resolution
 of $240\times 216$ is searched for in the library {\tt PK0288x0259}
 or as a PK-file with the name {\tt 288x259/cmr10.288pk}.

\section{Internals}
 How does the program function? What should be paid attention to,
 how can the font management be done as efficient as
 possible and adjusted to your own demands? These questions
 are to be answered in this chapter, where however the
 \ShowDVI{} program manual should be referenced, as the
 font management is described in detail over there, here
 however only the small difference to the management of the
 previewer is elaborated on. Thus it is recommended that you read
 the \ShowDVI{} manual first.


\subsection{Creation of fonts-not-found with Metafont}
In case the printer driver cannot find a font that is needed and
in case the environment variable ``CALLMF'' is set, the contents
of this variable is used for calling an ARexx script file.

This is called with the three following parameters, in order to create
the font that was not found:

\itemlist{-- }
\next with the name of the font to be created,
\next with the resolution of the font in DPI and
\next with the resolution, with which \DVIprint{} is printing.
\enditemlist

This means, that after

\qquad{\tt setenv CALLMF callmf}

\DVIprint{} would call the script with

\qquad{\tt callmf cmr10 360 300}

in case the font ``cmr10'' with the resolution
``magstep1'' should not be found and the printer in HP-DeskJet mode
would at the time print with a resolution of 300 dpi.

\subsection{Remember memory :)}
 The fact, that more available memory is always better than
 less, has been rumoured for some time now.
 What does the \DVIprint-program need the (relatively much) memory for?

 Obviously, the program needs some space.
 This however is not really much. The program
 is (at the time) approximately 65 KByte large.

 Then however, the bitmap that is to be printed must be kept
 in storage. The program reserves as much space as possible
 for this end, in the best case to get the entire bitmap for
 a page in the memory. This hunger for memory can be limited
 with the {\tt -m} option, however. Then the program will
 divide the bitmap up in strips and will print one strip after
 the other. If you are printing in the landscape mode, however,
 the entire bitmap must be in memory and the {\tt -m} option
 is ignored. In this case it can happen that the program needs
 a coherent chunk of memory space of 1 Megabyte.

 A further, significant memory eater is the font pool.
 In this the fonts are loaded. Is this space chosen too
 small, the program has to load and purge fonts continuously,
 which slows down the speed of printing considerably.
 The default value for the memory size has been set to 100 KByte.
 This can however be enlarged or reduced with the {\tt -b} option.
 The optimal size of the fontpool depends on the resolution of
 the output on the printer, as well as on the number of different
 fonts used in the \TeX document.

 Contrary to this, the two printer buffers, which are supposed
 to make the printout evenly (fast), only minimal.
 The default is a size of 10 KByte each. Thus all in all
 20 KByte is needed. You can make them smaller though,
 with a clear conscience, with the {\tt -e} option.
 If you set it below approximately 1 KByte however, the
 printout will become pretty slow.

 With the default values the program needs thus a maximum
 of 700 KByte. With the {\tt -m} and the {\tt -b} options,
 (per magnitude of resolution; $\approx200$) KByte
 can be saved though.

\subsection{Font management}
 The font management corresponds to that of the \ShowDVI{} program,
 except for a detail. This is the name of the font-configuration file.
 In case of the previewer, the name is {\tt showdvi.fnt}, in the same mould
 the one belonging to the printer driver is called {\tt dviprint.fnt}.

 As there are no further differences, no further discussion
 is necessary. Please read for this the manual to the
 \ShowDVI{} program.

\section{Required soft- and hardware}
In terms of software, firstly you need a program, which creates
DVI files. Normally this program is called {\tt virtex} or simply
{\tt tex}. Of great help is the ``arp.library'', as you would have
to give up environment variables otherwise.

Every now and then, the utility {\tt cmd} can be of use, with which
the output, which would have otherwise been sent to the printer, can be
redirected to a file.

In terms of hardware, above all you need an Amiga. The most
important expansion is a memory expansion. One MByte for main
storage space is the absolute minimum. A harddisk is not absolutely
necessary, but if you want to work reasonably, this one is a must,
too. Depending on the printer driver used and the number of the
fonts that are needed, upto 10 MByte of harddisk storage is
necessary.

\section{Known bugs}

With my NEC-P6 it has happened once in the Letter Quality
mode, that it has inserted a vertical skip. This can be
avoided with a reduction of the horizontal offset
({\tt -h} option). I have not been able to locate
the cause of the error.

Now and then, the frequency depending on what type of printer you use,
it occurs that the operating system displays a requester with
``Printer-Trouble'' and that the printer does not get any more data.
After clicking on the RETRY gadget, the printer resumes printing without
any problems. In case the requester appears more often, reducing the
printer buffer with the {\tt -e} option usually helps to eliminate these
disturbances.

I have not experienced other errors as yet.
Should you find one however, please send it to me in a reproducable
form (with log- and DVI file).


Translated from German to English by Thomas Tavoly -Okt '90.
\bye
