! README !

For compilation details and options see README_CC too!
======================================================

GENERAL INFORMATION
===================

This file  contains  documentation  for "dvilj" (the dvi-driver) and "crereslj"
(a font-loading-tool)  for the  "HP Laserjet+"  laser printer.  Both programmes
suppose in having the fontfiles in .pk-format.  Since .pxl-coded  files  become
more and more obsolete,  the corresponding pxl-programmes are  not longer main-
tained. Consequently they are not longer put on the distribution file. 


The files are as follows:

crereslj   Creates download-font-file for the  HP Laserjet+ 
 
dvilj      DVI-driver for  HP Laserjet+

paths.h    Some paths the driver needs that are system dependent.

These drivers allow the use of TeX on the HP Laserjet+ laser printer.

To run these programs, first create a tex source file, called, say,
'texstuff.tex'.  Create the 'texstuff.dvi' file by running tex:

$ tex texstuff

Create the 'texstuff.bit' file by running the driver:

$ dvilj [options ] texstuff

and send the bit file to the printer:

$ lp texstuff.bit

The UNIX lp command must call a 'raw' device, either by installing a model 'raw'
or 'thumb' within the queue or by using the option -oraw in the command line:  
    $ lp [-ddevice] texstuff.bit -oraw


As you can see, the driver expects a file with the suffix '.dvi',  and creates a
file with the suffix '.bit'.   This created file can then be submitted  directly
to the laser printer over the standard print queue to create the final document.

These drivers download fonts both  dynamically and permanently.  There is a file
called 
 
    /(respath)/reslj.fnt

which contains information about which fonts are  permanently  downloaded in the
laser printer. (respath) stands for the pathname of this file  and is defined in
file `paths.h', which should be customized to your local filesystem.  

The format of this file is as follows:

fontname size fontnumber orientation [ROM]
-------- ---- ---------- ----------- -----
fontname size fontnumber orientation [ROM]
MEMORY freemem
For example,

cmr10    300  5000       P
cmr10    300  5001       L
cmss10   324  5002       P            ROM 
MEMORY 364000                              

The above file would indicate that "cmr10" at a size of 300 (dpi) is downloaded
permanently in both the  portrait and landscape modes  at font number  5000 and
5001 resp. in the laser printer.  "cmss10" at 324 dpi on a 300 dpi device (mag-
step half)  is located in firmware in the portrait mode,  and there are  364000
free bytes that the driver can use for  dynamic  font downloading.   The actual
value of  'freemem'  is unimportant when you create the  'reslj.fnt'  file. The
real value will be determined by 'crereslj' and then written back. I don't know
if any TeX firmware (TeX font cartridges) exist for the HP-Laserjet.

Of course,  the fonts that are not in  ROM,  yet mentioned in the file,  must be
downloaded before any TeX jobs are run.  The crereslj program will create a file
called
 
    /(initpath)/initlj.fnt

which contains the quic commands to download the fonts mentioned in "reslj.fnt".
These programs must be run every time the "reslj.fnt" file is modified,  and  at
installation.  The created "initlj.fnt" file must be sent over the queue  before
any  TeX jobs,  and again after every laser printer power cycle or crash. 

The files from which the font information is loaded are
 
 /(fontpath)/dpisss/fontname.ssspk

with `sss' for the fontsize, corresponding to directories `dpisss' and fontnames
with an extension `.ssspk' (or whatever you have chosen for your  TeX-filesystem
in your "paths.h")

The number of fonts that should be permanently downloaded  depend on a number of
factors. If you have no TeX ROM fonts,  -  and  that's probably the case for the
HP-Laserjet printer  -  then it is highly recommended  that  at least the  three
most common sizes of "cmr10" (300, 329, 360 [.pk])  be downloaded.  At least 250
Kbytes should normally be available for dynamic downloading and graphics. Beyond
this,  which fonts to permanently download is up to the discretion of the system
manager. Just edit the reslj.fnt files to match or optimize your enviroment.

! Values for 'fontnumber' in reslj.fnt should be chosen not to conflict with the
! dynamically downloaded fonts,  whose 'fontnumbers' are determined by the value
! DYNAMICFONTBASE, which is decremented by one for every different font, used in
! the processed document.


It is recommended that `dvilj' (the executable program) be placed in /usr/bin or
/usr/local/bin.  `crerelj' should be put where the superuser can get to it if he
changes fonts.


OPTIONS
=======

When dvilj is called,  there are a number of  options  that can be placed on the
command line.  These are:

-s=nnn            Selects a starting page.  nnn can be a number,  or, if the pa-
or                rameter is enclosed in quotes,  a splat.   There can be  up to
-s="nnn.nnn.nnn"  ten fields,  each one corresponding to one of the count values
                  in TeX.  The first is normally the page number.

-p=nnn            Sets the maximum number of pages to be printed after the star-
		  ting page.

-c=nnn            Prints  nnn < 100 copies.  Note that the copies  will  not  be
                  collated.  Thus,  a  two page  document with a request for ten
		  copies will be printed as  ten copies of page one  followed by
		  ten copies of page two.

-f=nnn            Maximum number of  fonts  that can be downloaded.  This option
		  can be used to overcome a Laserjet+ restriction:  Although the
		  Laserjet+ allows to download up to 32 fonts, only 16 different
		  fonts can be used on a single page.  If the maximum number  of
		  downloadable fonts  is restricted to  16,  all remaining fonts
		  will be drawn in  graphics mode,  which is restricted only  by
		  the printers memory.  But it is not wise to use this option in
		  general for the whole document, since unnecessary time consum-
                  ing graphic drawing might occur.  Instead use this option just
		  for the  special pages on which this restriction will be rele-
		  vant and print them seperately by using the  -s=nnn  and  -p=1
		  option.

-v=fffdim         Page offsets: v - vertical [top] offset
-h=fffdim                       h - horizontal [left] offset
-r=fffdim                       r - horizontal [left] offset  on reversal pages.
				    (see 'two-sided' printing mode)
		  fff can be any float format  and the allowed dimensions are:
		               i[n]  for inches
			       c[m]  for centimeter
			       m[m]  for millimeter
			       p[t]  for points
			       d[ot] for dots
                  No space may occure between fff and dim!

-x=float          Magnify (eXtend) the output by the value given by float. It
		  is the responsibility of the user to choose only such floating
		  numbers,  which correspond to existing font sizes,  e.g.: 0.8,
		  1.095, 1.2, 1.44 ...

-e=n              Magnify (Enlarge) the output by magstep n. (= 1.2**n in FOR-
		  TRAN notation) n=2.5 corresponds to TeX's combined notation:
		  \magstephalf\magstep2. As for -x it is on the responsibility
		  of the user to choose only values for existing font sizes.

-l                Print the document in the  landscape mode  (with the text run-
		  ning parallel to the long side of the page.)

-m                Manual page feed.

-o                Print pages in opposite (reversal) order. Last ordered page is
		  printed first,  followd by the  second last page etc.  down to
		  the first ordered page.

-t                Two side printing.  First,  all even  pages are printed with a
		  left offset chosen by the 'r' value above.  The output package
		  of the even pages occur in natural order,  i. e. the last even
		  page is on the top of the package  or  it is a blank sheet  if
		  the last page of the document has an odd number. 
		  You have two choices in printing the odd pages:
		  After the first path,  the printer  is  switched into  'manual
		  feeding mode',  so  you could print  the  odd pages  by manual
		  feeding. 
		  Or flip the stack of paper back into the paper cassette  (with
		  the printed side of paper facing up and the  top at the end of
		  the cassette that enters the printer first).  Take the printer
		  'off-line', press the 'manual-feed' switch to exit the  manual
		  feed mode and return to 'on-line' again.  After this procedure
		  the printer starts immediately  in printing the  odd pages  by
		  feeding them from the cassette. The final output is in natural
		  order: i. e. the first page is facing up and on the top of the
		  output package. The left offset of the odd pages is determined
		  by the 'h' value above.

-d                Turns on the debug mode. 


SPECIALS
========

There are a few number of  TeX's  \special  commands  that are supported by this
driver.  Those specials which have optional parameters must each be followed  by
parenthesis enclosing any parameters. They are normally called, for instance, as

\special{landscape}
or
\special{grafix(parameter)}

The available specials are:

landscape         Result will be the same as produced by -l option,  but the re-
		  quest for this mode is made in the .tex file  already  instead
		  by the driver option.  No arguments.

grafix(...)       Include  graphic pixel file  at the current location  into the
		  bit file.  The first argument (required) is the external  file
		  name.  (Arguments  are  separated  by  spaces.)  The following
		  arguments may be used:
		    300     graphic resolution is 300 dots/inch
		    150                           150             (default)
		    100                           100
		     75                            75
                  The graphic file must have the following format:
		        short = number of pixel rows
		        byte  = flag (0 or 1)
		        byte  = number of pixel bytes per row if flag is 0, fol-
			lowed by the pixel byte stream.  If flag is 1,  the next
			byte gives the length for the first row, followed by the
			pixel bytes for the first row. The next byte then is in-
			terpreted  as the length of the second row  followed  by
			the pixel bytes for the second row and so on. 
			This restricts the max row length to 255 bytes,  but for
			the default resolution this is actually 13.6 inches  and
			still 6.8 inches for full resolution.
               
move(...)         Since the graphic will be drawn with the  upper left corner at
		  the current cursor position, this special can be used for cur-
		  sor positioning.  Allowed arguments are:
		    h[=]fffdim  v[=]fffdim  r[el]  a[bs]
		  no space may occure between  h, v and =  and between = and fff
		  or h, v  and  fff  as between fff and dim.  Allowed dimensions
		  are the same as under the offset option.  Positioning is  done
		  relativ (rel) to the current cursor  or  absolute (abs) to the
		  upper left page corner.

include(file)     Directly include 'file' into the bit file.

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

SYSTEM DEPENDENCIES
===================

All programmes in this package are written in C, using the UNIX C standard lib.a
for some routines. Most or all of this routines should be available for C-compi-
lers under different systems also.  The used routines are actually:
      printf, scanf, fprintf, fscanf, fputs, fread, fwrite, sprintf,
      getc, putc, getw, fopen, fclose, fseek, ftell, malloc,
      strcpy, strcat, strcmp
It is assumed, getc returns an unsigned value and  type char has a signed value.
-------------------------------------------------------------------------------

For any problem that may occur, feel free to contact me.

                               ------ Helmut Kopka   updated April 5. 90

				      Max-Planck-Institut fuer Aeronomie
				      D-4311 Katlenburg-Lindau
				      FRG
				      Tel: 49-5556-401451

