[comp.text] dvi2ps/PostScript package

lamy@ai.toronto.edu (12/01/86)

I have received many requests for software that allows including Macintosh
and other PostScript illustrations in TeX output. So here it comes, in
3 parts.

dvi2ps.c    A translator from TeX dvi output to PostScript.  This version
            fixes trivial bugs (use of tolower under Berkeley) and trivial
            changes in the processing of \special inclusions. I've included
            it in its entirety because of popular demand.

findfile.c
findfile.h
commands.h  all used by above.

Makefile    cheapo version
dvi2ps.1    n/troff version of the man page, courtesy bur@iro.udem.cdn

tex.ps      The header file used by dvi2ps.  This version modified to
            be more portable and to behave itself properly wrt PostScript
            illustrations.  Overrides some definitions from the LaserPrep
            file below.
LaserPrep.uu  uuencoded version of LaserPrep.ps  The header file needed for
            Macintosh illustrations, with all the patches that made it here.
            I have broken so many mailers and it has been damaged by so many
            other mailers that I had to choose that route.

Bugs you don't report won't get fixed.

In the queue: including troff preprocessor (pic, grap, S, ideal, ...) output
in TeX documents, and posting the software we have here for doing inclusions
in troff documents.

Jean-Francois Lamy
AI Group, Dept of Computer Science     CSNet: lamy@ai.toronto.edu
University of Toronto		       EAN:   lamy@ai.toronto.cdn
Toronto, ON, Canada M5S 1A4	       UUCP:  lamy@utai.uucp
-------------------------------------------------------------------------------
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	dvi2ps.l
#	Makefile
#	tex.ps
#	commands.h
#	findfile.h
# This archive created: Sun Nov 30 19:04:41 1986
export PATH; PATH=/bin:$PATH
if test -f 'dvi2ps.l'
then
	echo shar: will not over-write existing file "'dvi2ps.l'"
else
cat << \SHAR_EOF > 'dvi2ps.l'
.TH DVI2PS 1 "14 November 1986"
.SH NAME
dvi2ps \- convert a DVI file to PostScript
.SH SYNOPSIS
.B dvi2ps
.RB [ \-a
.IR pxldir ]
.RB [ \-c ]
.RB [ \-d ]
.RB [ \-f
.IR n ]
.RB [ \-h ]
.RB [ \-i
.IR file ]
.RB [ \-m
.IR n ]
.if n .ti +0.5i
.RB [ \-n
.IR n ]
.RB [ \-o
.IR str ]
.RB [ \-p ]
.RB [ \-q ]
.if t .ti +0.5i
.RB [ \-r ]
.RB [ \-s ]
.RB [ \-t
.IR n ]
.RB [ \-w ]
.if n .ti +0.5i
\fIdvifile\fP[\fB.dvi\fP]
.SH DESCRIPTION
This program converts a DVI file to PostScript, and writes the result
to standard output.  The result requires a small amount of PostScript
source to precede it to the printer, before it can be successfully printed.
(By default, that PostScript code is prepended to the output.)
.SH OPTIONS
.IP "\fB\-a \fIpxldir"
specify different area for PXL files.
Directory
.I pxldir
is searched
for all PXL files, instead of the default directory.
.IP \fB\-c
create an output file in the spool directory.
This is fairly Apollo-specific, and may be disabled at other
sites.  When given, the output is directed to a file with
a unique name, created in a spool directory.
.IP \fB\-d
select debugging output (you probably don't want to).
.IP "\fB\-f \fIn"
specify a starting page number
(this is a TeX page number \- \\count0).
.IP \fB\-h
do not copy the standard header file.
This option prevents the standard PostScript header file being
prepended to the output.
.IP "\fB\-i \fIfile"
copy the named file to the output.
The contents of the file named will be copied to the output
after the standard header file has been copied.
.TP
\fB\-m0\fP | \fB\-mh\fP | \fB\-m1\fP | \fB\-m2\fP | \fB\-m3\fP | \fB\-m4\fP
specify a magstep to use to print the document.  This overrides
whatever might be in the DVI file.
.IP "\fB\-m \fIn"
specify a magnification to use to print the document.  This should
probably be one of the magic numbers 1000, 1095, 1200, 1440, 1728,
or 2074, but no checking is done.  Note: if your site does not have the
complete set of 300 dpi fonts, this option might be disabled.
.IP "\fB\-n \fIn"
specify the number of copies to print.
.IP "\fB\-o \fIstr"
specify a printing option.
Valid options are
.BR letter ,
.BR note ,
.BR legal ,
.BR landscape ,
.BR envelope ,
and
.BR manualfeed .
This argument may be repeated several times.
.B envelope
is a variant of
.B landscape
that selects manual feed and does proper positioning for regular envelopes.
.IP \fB\-p
do not preload font information.
Occasionally there may be insufficent memory to hold the
information about all of the fonts in the system.  Portions
of the document may be converted by including the
.B \-p
option on the command line.  This will prevent the preloading of
all fonts into the system and instead use demand loading of
the font tables. 
.IP \fB\-q
be quiet.
Don't chatter about pages converted, etc.
.IP \fB\-r
stack pages in reverse order.  
Normally, the DVI pages are processed in reverse order, with the
result that they are stacked in the correct order in the output
tray.  This option reverses that.
.IP \fB\-s
turn on printing of statistics.
Some versions of
.I dvi2ps
will optionally print statistics about
font usage and some other information that is generally only 
interesting to developers.  On these systems,
.B \-s
turns on
the statistics printing.
.IP "\fB\-t \fIn"
specify an ending page number.
.IP \fB\-w
Don't print out warnings.
.SH NOTES
This is a `bare bones' DVI-to-PostScript program.  Minimal error
checking is done.

Not all fonts are available in the resolution needed to display on the 
laser printer;  when a missing font is encountered,
.I dvi2ps
will continue 
to process your DVI file, and will log a warning message. Gaps will 
appear in the document where the missing characters should have been.

It can take up to 60 seconds for the first page to be output.  After a
head of steam has been built up, it can roll along at 5-10 seconds
per page.

.SH PostScript ILLUSTRATIONS

This program supports use of the \fB\\special\fP command in TeX to include
special PostScript code for graphics, etc.  Specifying
\fB\\special{psfile=foo.ps}\fP in the TeX source will result in the contents
of file
.I foo.ps
(assumed to contain PostScript code) being copied 
into the output at that point.  For most included graphics, the
user's (0,0) point will be set to the point of the \fB\\special\fP command
with
.I x
and
.I y
coordinates increasing up and to the right and in units
of PostScript points (72/inch) \(em thus you must explicitly leave space
above the \fB\\special\fP command for most graphics.  For graphics produced by 
Apple Macintoshes (i.e., MacDraw, MacPaint, etc.), the top left corner of 
the drawing will be at the point of the \fB\\special\fP command; in this case
you must leave the required space below the \fB\\special\fP.

The \fB\\special\fP string can contain any number of the following 
.I keyword=value
pairs, separated by blanks:
.ta 10n
.TP 24n
\fIKeyword	Value Type
(dimensions in points: 72 pt = 1 in)
.TP
psfile	string   
\- PostScript file to include
.PD 0
.TP
hsize	dimension
\- maximum horizontal size (for clipping)
.TP
vsize	dimension
\- maximum vertical size (for clipping). Use negative values to specify a
clipping region below the current position.
.TP
hoffset	dimension
\- amount to shift right
.TP
voffset	dimension
\- amount to shift up
.TP
hscale	number
\- scale factor in x-dimension
.TP
vscale	number
\- scale factor in y-dimension
.TP
rotation	number
\- counter-clockwise rotation angle
.PD
.DT
.PP
Thus:
.ce
\fB\\special{psfile=foo.ps hoffset=72 hscale=0.9 vscale=0.9}\fP
will shift the graphics produced by file
.I foo.ps
right by
1", and will draw it at 0.9 normal size.

.B hsize
and
.B vsize
are given relative to the (0,0) point of the
drawing and are unaffected by offsets and scales.

Offsets are given relative to the point of the \fB\\special\fP command,
and are unaffected by scales.

If Macintosh drawings are to be included, the proper LaserPrep file
must be downloaded to the printer, either permanently or as another
header file in addition to the standard
.I tex.ps
header file.
.SH FILES
.PD 0
.TP 2.2i
*.dvi
TeX DeVice Independent output file
.TP
/usr/lib/tex/fonts/*.*pxl
default area for PXL files (TeX font rasters)
.TP
/usr/lib/tex/ps/tex.ps
PostScript support code
.PD
.SH "SEE ALSO"
tex(1)
.SH BUGS
There is likely a limit to the size of documents that can be printed (at 
least, on the Apple LaserWriter).  If you get VMerrors reported when 
printing, use the
.B \-f
and
.B \-t
options, to select a range of pages.
The exact limit is unknown, but is probably well in excess of 50 pages
for `normal' documents, decreasing with number of different fonts used,
size of fonts, etc.

.SH AUTHORS
Mark Senn wrote the early versions of this program for the
BBN BitGraph.  Stephan Bechtolsheim, Bob Brown, Richard
Furuta, James Schaad and Robert Wells improved it.  Norm
Hutchinson ported the program to the Sun.  Neal Holtz ported
it to the Apollo, and then to produce PostScript.
Scott Jones added intelligent font substitution.
Jean-Francois Lamy fixed the interface for PostScript illustrations.

(PostScript is a trademark of Adobe Systems, Inc.)
SHAR_EOF
fi # end of overwriting check
if test -f 'Makefile'
then
	echo shar: will not over-write existing file "'Makefile'"
else
cat << \SHAR_EOF > 'Makefile'
# The following file and directory specifications may need changing at
# your site:
#
# where are the bitmaps stored?
FONTAREA=/usr/lib/tex/fonts
#
# where is the header file to be found?
# (Here, the ps directory under lib/tex is in fact a link to where all ps
#  files are kept.  You must create a directory or a link yourself)
HDRFILE=/usr/lib/tex/ps/tex.ps
#
# where is the software to be installed
BINAREA=/usr/local
#
# an Apollo-specific spool file
SPOOLFILE=/usr/spool/laserwriter/apollo
#

CFLAGS = -DFONTAREA=\"${FONTAREA}\" -DHDRFILE=\"${HDRFILE}\" \
         -DSPOOLFILE=\"${SPOOLFILE}\" -O

all: dvi2ps

dvi2ps:	dvi2ps.o findfile.o
	cc ${CFLAGS} -o dvi2ps dvi2ps.o findfile.o

install: all
	install -s -m 755 dvi2ps ${BINAREA}/dvi2ps
	cp tex.ps ${HDRFILE}

#
# The following may be useful if you are trying to run this as a
# printcap filter
#

applef:	applef.c
	${CC} -o applef ${CFLAGS} applef.c

dvipsf:	dvipsf.c
	${CC} -o dvipsf ${CFLAGS} dvipsf.c
SHAR_EOF
fi # end of overwriting check
if test -f 'tex.ps'
then
	echo shar: will not over-write existing file "'tex.ps'"
else
cat << \SHAR_EOF > 'tex.ps'
%! $Header: tex.ps,v 1.5 86/11/27 10:30:54 lamy Exp $
%
% for use by dvi2ps Version 2.11 or later.
%
% a start (Ha!) at a TeX mode for PostScript.
% The following defines procedures assumed and used by program "dvi2ps"
% and must be downloaded or sent as a header file for all TeX jobs.
%
% Original author: 
%      Neal Holtz, Carleton University, Ottawa, Canada
%      <holtz@cascade.carleton.cdn>
%      <holtz%cascade.carleton.cdn@relay.cs.net>
%      June, 1985   Last Modified: Aug 25/85
%
% PostScript illustration support:
%      Jean-Francois Lamy, AI group, University of Toronto, Canada
%      lamy@ai.toronto.edu, lamy@ai.toronto.cdn
%
% $Log:	tex.ps,v $
% Revision 1.5  86/11/27  10:30:54  lamy
% Mixing Mac and other PostScript illustrations now possible.
% vsize positive now means "above current point".
% 
% Revision 1.4  86/10/30  12:43:24  lamy
% Now uses the rotate operator for landscape and envelope modes.
% Used to be convoluted, non portable code to avoid round-off errors
% that do not seem to be present on any of our printers.
% 
% Revision 1.3  86/10/30  12:27:50  lamy
% Fixed bug in @bop1 that caused top lines to be clipped when using proc.sty
%
% 86-07-17 jfl
%   Added envelope keyword definition.  Same as landscape but positioned
%   so that an envelope inserted upside down is printed correctly
%   This reduces the occurence of paper jams.
%
% 86-06-23  JF Lamy, U. of Toronto <lamy@ai.toronto.edu, lamy@utai.uucp>
%   Updated to support the Macintosh LaserWriter driver version 3.x
%   instead of 1.1.  Added rotation of illustrations.
% 
% oystr 12-Feb-1986
%   Changed @dc macro to check for badly formed bits in character
%   definitions.  Can get a <> bit map if a character is not actually
%   in the font file.  This is absolutely guaranteed to drive the
%   printer nuts - it will appear that you can no longer define a
%   new font, although the built-ins will still be there.
%

% To convert this file into a downloaded file instead of a header
% file, uncomment all of the lines beginning with %-%

%-%0000000 			% Server loop exit password
%-%serverdict begin exitserver
%-%  systemdict /statusdict known
%-%  {statusdict begin 9 0 3 setsccinteractive /waittimeout 300 def end}
%-% if

/TeXDict 200 dict def   % define a working dictionary
TeXDict begin           % start using it.

                        % units are in "dots" (300/inch)
/Resolution 300 def
/Inch  {Resolution mul} def  % converts inches to internal units

/PageCounter statusdict begin pagecount end def  % so we can report # pages printed

/Mtrx 6 array def

%%%%%%%%%%%%%%%%%%%%% Page setup (user) options %%%%%%%%%%%%%%%%%%%%%%%%

% dvi2ps will output coordinates in the TeX system ([0,0] 1" down and in
% from top left, with y +ive downward).  The default PostScript system
% is [0,0] at bottom left, y +ive up.  The Many Matrix Machinations in
% the following code are an attempt to reconcile that. The intent is to
% specify the scaling as 1 and have only translations in the matrix to
% properly position the text.  Caution: the default device matrices are
% *not* the same in all PostScript devices; that should not matter in most 
% of the code below (except for lanscape mode -- in that, rotations of
% -90 degrees resulted in the the rotation matrix [ e 1 ]
%                                                 [ 1 e ]
% where the "e"s were almost exactly but not quite zeros.
%


/@letter
  { letter initmatrix
    72 Resolution div dup neg scale          % set scaling to 1.
    310 -3005 translate      % move origin to top (these are not exactly 1"
    Mtrx currentmatrix pop   % and -10" because margins aren't set exactly right)
  } def
        % note mode is like letter, except it uses less VM
/@note
  { note initmatrix
    72 Resolution div dup neg scale          % set scaling to 1.
    310 -3005 translate                      % move origin to top
    Mtrx currentmatrix pop
  } def

/@landscape
  { letter initmatrix
    72 Resolution div dup neg scale          % set scaling to 1.
    -90 rotate                    % it would be nice to be able to do this
%    Mtrx currentmatrix 0 0.0 put % but instead we have to do things 
%                                 % like this because what should be zero
%    Mtrx 1 -1.0 put      %  terms aren't (and text comes out wobbly)
%    Mtrx 2 1.0 put       % Fie!  This likely will not work on QMS printers
%    Mtrx 3 0.0 put       % (nor on others where the device matrix is not like
%    Mtrx  setmatrix      %  like it is on the LaserWriter).
    300 310  translate    % move origin to top
    Mtrx currentmatrix pop
  } def

/@legal
  { legal initmatrix
    72 Resolution div dup neg scale          % set scaling to 1.
    295 -3880 translate                      % move origin to top
    Mtrx currentmatrix pop
  } def

/@manualfeed
   { statusdict /manualfeed true put
   } def
        % n @copies -   set number of copies
/@envelope
  { statusdict /manualfeed true put
    letter initmatrix
    72 Resolution div dup neg scale          
    -90 rotate 
%    Mtrx currentmatrix 0 0.0 put             
%    Mtrx 1 -1.0 put                          
%    Mtrx 2 1.0 put                           
%    Mtrx 3 0.0 put                           
%    Mtrx  setmatrix                          
    450 1275 translate % upper right corner of regular envelope
                       % when fed manually
    300 310  translate
    Mtrx currentmatrix pop
  } def


/@copies
   { /#copies exch def
   } def

%%%%%%%%%%%%%%%%%%%% Procedure Defintions %%%%%%%%%%%%%%%%%%%%%%%%%%

/@newfont       % id @newfont -         -- initialize a new font dictionary
  { /newname exch def
    pop
    newname 7 dict def          % allocate new font dictionary
    newname load begin
        /FontType 3 def
        /FontMatrix [1 0 0 -1 0 0] def
        /FontBBox [0 0 1 1] def
        /BitMaps 128 array def
        /BuildChar {CharBuilder} def
        /Encoding 128 array def
        0 1 127 {Encoding exch /.undef put} for
        end
    newname newname load definefont pop
  } def


% the following is the only character builder we need.  it looks up the
% char data in the BitMaps array, and paints the character if possible.
% char data  -- a bitmap descriptor -- is an array of length 6, of 
%          which the various slots are:

/ch-image {ch-data 0 get} def   % the hex string image
/ch-width {ch-data 1 get} def   % the number of pixels across
/ch-height {ch-data 2 get} def  % the number of pixels tall
/ch-xoff  {ch-data 3 get} def   % number of pixels below origin
/ch-yoff  {ch-data 4 get} def   % number of pixels to left of origin
/ch-tfmw  {ch-data 5 get} def   % spacing to next character

/CharBuilder    % fontdict ch Charbuilder -     -- image one character
  { /ch-code exch def           % save the char code
    /font-dict exch def         % and the font dict.
    /ch-data font-dict /BitMaps get ch-code get def     % get the bitmap descriptor for char
    ch-data null eq not
      { ch-tfmw   0   ch-xoff neg   ch-yoff neg   ch-width ch-xoff sub   ch-height ch-yoff sub
            setcachedevice
        ch-width ch-height true [1 0  0 1  ch-xoff ch-yoff]
            {ch-image} imagemask
      }
    if
  } def


/@sf            % fontdict @sf -        -- make that the current font
  { setfont() pop
  } def

                % in the following, the font-cacheing mechanism requires that
                % a name unique in the particular font be generated

/@dc            % char-data ch @dc -    -- define a new character bitmap
  { /ch-code exch def
% ++oystr 12-Feb-86++
    dup 0 get
    length 2 lt
      { pop [ <00> 1 1 0 0 8.00 ] } % replace <> with null
    if
% --oystr 12-Feb-86--
    /ch-data exch def
    currentfont /BitMaps get ch-code ch-data put
    currentfont /Encoding get ch-code 
       dup (   ) cvs cvn   % generate a unique name simply from the character code
       put
  } def

/@bop0           % n @bop0 -        -- begin the char def section of a new page
  { 
  } def

/@bop1           % n @bop1 -        -- begin a brand new page
  { pop
    erasepage initgraphics 
    Mtrx setmatrix
    0 0 moveto
    /SaveImage save def
  } def

/@eop           % - @eop -              -- end a page
  { showpage 
    SaveImage restore
  } def

/@start         % - @start -            -- start everything
  { @note                             % (there is not much to do)
  } def

/@end           % - @end -              -- done the whole shebang
  { end
  } def

/p              % x y p -               -- move to position
  { moveto
  } def

/r              % x r -                 -- move right
  { 0 rmoveto
  } def

/s              % string s -            -- show the string
  { show
  } def

/c              % ch c -                -- show the character (code given)
  { c-string exch 0 exch put
    c-string show
  } def

/c-string ( ) def

/ru             % dx dy ru -   -- set a rule (rectangle)
  { /dy exch neg def    % because dy is height up from bottom
    /dx exch def
    /x currentpoint /y exch def def   % remember current point
    newpath x y moveto
    dx 0 rlineto
    0 dy rlineto
    dx neg 0 rlineto
    closepath fill
    x y moveto
  } def

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%     the \special command junk
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   The structure of the PostScript produced by dvi2ps for \special is:
%         @beginspecial
%           - any number of @hsize, @hoffset, @hscale, etc., commands
%         @setspecial
%           - the users file of PostScript commands
%         @endspecial

% The @beginspecial command recognizes whether the Macintosh Laserprep
% has been loaded or not, and redfines some Mac commands if so.
% The @setspecial handles the users shifting, scaling, clipping commands


% The following are user settable options from the \special command.

/@SpecialDefaults
  { 
    /hsi 72 8.5 mul def  % 8.5 Inch def
    /vsi 72 11 mul def   % 11 Inch def
    /hof 0 def
    /vof 0 def
    /hsc 1 def
    /vsc 1 def
    /rotat 0 def
    /CLIP false def
  } def

%       d @hsize -      specify a horizontal clipping dimension
%                       these 2 are executed before the MacDraw initializations
/@hsize {/hsi exch def /CLIP true def} def
/@vsize {/vsi exch def /CLIP true def} def
%       d @hoffset -    specify a shift for the drwgs
/@hoffset {/hof exch def} def
/@voffset {/vof exch def} def
%       s @hscale -     set scale factor
/@hscale {/hsc exch def} def
/@vscale {/vsc exch def} def
%       r @rotation -   set rotation angle
/@rotation {/rotat exch def} def

/@setclipper
  {
    CLIP
      { newpath 0 0 moveto hsi 0 rlineto 0 vsi rlineto hsi neg 0 rlineto 
        closepath clip }
    if
  } def

% this will be invoked as the result of a \special command (for the
% inclusion of PostScript graphics).  The basic idea is to change all
% scaling and graphics back to defaults, but to shift the origin
% to the current position on the page (left margin?)

/@beginspecial          % - @beginspecial -     -- enter special mode
  { gsave /SpecialSave save def
          % the following magic incantation establishes the current point as
          % the users origin, and reverts back to default scalings, rotations
    currentpoint transform initgraphics itransform translate
    @SpecialDefaults    % setup default offsets, scales, sizes
    @MacSetUp           % fix up Mac stuff 
  } def

/@setspecial    % to setup user specified offsets, scales, sizes (for clipping)
  {
   hof vof translate
   @setclipper
   hsc vsc scale 
   rotat rotate
  } def

/@endspecial            % - @endspecial -       -- leave special mode
  { 
    SpecialSave restore
    grestore
  } def

% - @MacSetUp -   turn-off/fix-up all the LaserPrep stuff that might hurt us

/@MacSetUp
  { userdict /md known  % if md is defined
      { userdict /md get type /dicttype eq      % and if it is a dictionary
         { /MacDrwgs true def
           md begin                             % then redefine some stuff
              
	      /txpose{
		 1 -1 scale  % make y coordinates relative to top of figure
	      } bind def

              % ignore Mac page breaks
              /cp {pop pop} bind def

           end }
        if }
    if    
  } def

end                     % revert to previous dictionary
SHAR_EOF
fi # end of overwriting check
if test -f 'commands.h'
then
	echo shar: will not over-write existing file "'commands.h'"
else
cat << \SHAR_EOF > 'commands.h'
/*
 *
 * $Revision: 1.1 $
 * $Log:	commands.h,v $
 * Revision 1.1  83/11/23  10:56:00  mds
 * Initial revision
 * 
 *
 */
#define  SETC_000    0
#define  SETC_001    1
#define  SETC_002    2
#define  SETC_003    3
#define  SETC_004    4
#define  SETC_005    5
#define  SETC_006    6
#define  SETC_007    7
#define  SETC_008    8
#define  SETC_009    9
#define  SETC_010   10
#define  SETC_011   11
#define  SETC_012   12
#define  SETC_013   13
#define  SETC_014   14
#define  SETC_015   15
#define  SETC_016   16
#define  SETC_017   17
#define  SETC_018   18
#define  SETC_019   19
#define  SETC_020   20
#define  SETC_021   21
#define  SETC_022   22
#define  SETC_023   23
#define  SETC_024   24
#define  SETC_025   25
#define  SETC_026   26
#define  SETC_027   27
#define  SETC_028   28
#define  SETC_029   29
#define  SETC_030   30
#define  SETC_031   31
#define  SETC_032   32
#define  SETC_033   33
#define  SETC_034   34
#define  SETC_035   35
#define  SETC_036   36
#define  SETC_037   37
#define  SETC_038   38
#define  SETC_039   39
#define  SETC_040   40
#define  SETC_041   41
#define  SETC_042   42
#define  SETC_043   43
#define  SETC_044   44
#define  SETC_045   45
#define  SETC_046   46
#define  SETC_047   47
#define  SETC_048   48
#define  SETC_049   49
#define  SETC_050   50
#define  SETC_051   51
#define  SETC_052   52
#define  SETC_053   53
#define  SETC_054   54
#define  SETC_055   55
#define  SETC_056   56
#define  SETC_057   57
#define  SETC_058   58
#define  SETC_059   59
#define  SETC_060   60
#define  SETC_061   61
#define  SETC_062   62
#define  SETC_063   63
#define  SETC_064   64
#define  SETC_065   65
#define  SETC_066   66
#define  SETC_067   67
#define  SETC_068   68
#define  SETC_069   69
#define  SETC_070   70
#define  SETC_071   71
#define  SETC_072   72
#define  SETC_073   73
#define  SETC_074   74
#define  SETC_075   75
#define  SETC_076   76
#define  SETC_077   77
#define  SETC_078   78
#define  SETC_079   79
#define  SETC_080   80
#define  SETC_081   81
#define  SETC_082   82
#define  SETC_083   83
#define  SETC_084   84
#define  SETC_085   85
#define  SETC_086   86
#define  SETC_087   87
#define  SETC_088   88
#define  SETC_089   89
#define  SETC_090   90
#define  SETC_091   91
#define  SETC_092   92
#define  SETC_093   93
#define  SETC_094   94
#define  SETC_095   95
#define  SETC_096   96
#define  SETC_097   97
#define  SETC_098   98
#define  SETC_099   99
#define  SETC_100  100
#define  SETC_101  101
#define  SETC_102  102
#define  SETC_103  103
#define  SETC_104  104
#define  SETC_105  105
#define  SETC_106  106
#define  SETC_107  107
#define  SETC_108  108
#define  SETC_109  109
#define  SETC_110  110
#define  SETC_111  111
#define  SETC_112  112
#define  SETC_113  113
#define  SETC_114  114
#define  SETC_115  115
#define  SETC_116  116
#define  SETC_117  117
#define  SETC_118  118
#define  SETC_119  119
#define  SETC_120  120
#define  SETC_121  121
#define  SETC_122  122
#define  SETC_123  123
#define  SETC_124  124
#define  SETC_125  125
#define  SETC_126  126
#define  SETC_127  127
#define  SET1          128
#define  SET2          129
#define  SET3          130
#define  SET4          131
#define  SET_RULE      132
#define  PUT1          133
#define  PUT2          134
#define  PUT3          135
#define  PUT4          136
#define  PUT_RULE      137
#define  NOP           138
#define  BOP           139
#define  EOP           140
#define  PUSH          141
#define  POP           142
#define  RIGHT1        143
#define  RIGHT2        144
#define  RIGHT3        145
#define  RIGHT4        146
#define  W0            147
#define  W1            148
#define  W2            149
#define  W3            150
#define  W4            151
#define  X0            152
#define  X1            153
#define  X2            154
#define  X3            155
#define  X4            156
#define  DOWN1         157
#define  DOWN2         158
#define  DOWN3         159
#define  DOWN4         160
#define  Y0            161
#define  Y1            162
#define  Y2            163
#define  Y3            164
#define  Y4            165
#define  Z0            166
#define  Z1            167
#define  Z2            168
#define  Z3            169
#define  Z4            170
#define  FONT_00    171
#define  FONT_01    172
#define  FONT_02    173
#define  FONT_03    174
#define  FONT_04    175
#define  FONT_05    176
#define  FONT_06    177
#define  FONT_07    178
#define  FONT_08    179
#define  FONT_09    180
#define  FONT_10    181
#define  FONT_11    182
#define  FONT_12    183
#define  FONT_13    184
#define  FONT_14    185
#define  FONT_15    186
#define  FONT_16    187
#define  FONT_17    188
#define  FONT_18    189
#define  FONT_19    190
#define  FONT_20    191
#define  FONT_21    192
#define  FONT_22    193
#define  FONT_23    194
#define  FONT_24    195
#define  FONT_25    196
#define  FONT_26    197
#define  FONT_27    198
#define  FONT_28    199
#define  FONT_29    200
#define  FONT_30    201
#define  FONT_31    202
#define  FONT_32    203
#define  FONT_33    204
#define  FONT_34    205
#define  FONT_35    206
#define  FONT_36    207
#define  FONT_37    208
#define  FONT_38    209
#define  FONT_39    210
#define  FONT_40    211
#define  FONT_41    212
#define  FONT_42    213
#define  FONT_43    214
#define  FONT_44    215
#define  FONT_45    216
#define  FONT_46    217
#define  FONT_47    218
#define  FONT_48    219
#define  FONT_49    220
#define  FONT_50    221
#define  FONT_51    222
#define  FONT_52    223
#define  FONT_53    224
#define  FONT_54    225
#define  FONT_55    226
#define  FONT_56    227
#define  FONT_57    228
#define  FONT_58    229
#define  FONT_59    230
#define  FONT_60    231
#define  FONT_61    232
#define  FONT_62    233
#define  FONT_63    234
#define  FNT1          235
#define  FNT2          236
#define  FNT3          237
#define  FNT4          238
#define  XXX1          239
#define  XXX2          240
#define  XXX3          241
#define  XXX4          242
#define  FNT_DEF1      243
#define  FNT_DEF2      244
#define  FNT_DEF3      245
#define  FNT_DEF4      246
#define  PRE           247
#define  POST          248
#define  POST_POST     249
SHAR_EOF
fi # end of overwriting check
if test -f 'findfile.h'
then
	echo shar: will not over-write existing file "'findfile.h'"
else
cat << \SHAR_EOF > 'findfile.h'
/* findfile.h
 * Copyright 1985 Massachusetts Institute of Technology
 */

extern int findfile();
/* int findfile(dirvec,dirveclen,area, name, mag, s, nname, nmag)
 *     char *dirvec[],*area,*name,*s,*nname;
 *     int dirveclen,mag,*nmag;
 */

SHAR_EOF
fi # end of overwriting check
#	End of shell archive
exit 0

lamy@ai.toronto.edu (12/01/86)

part 2 of 3

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	dvi2ps.c
# This archive created: Sun Nov 30 19:06:07 1986
export PATH; PATH=/bin:$PATH
if test -f 'dvi2ps.c'
then
	echo shar: will not over-write existing file "'dvi2ps.c'"
else
cat << \SHAR_EOF > 'dvi2ps.c'
#define VERSION "2.11"

/* $Header: dvi2ps.c,v 1.3 86/11/27 13:55:03 lamy Exp $
 *
 * AUTHOR(s)
 *     Mark Senn wrote the early versions of this program for the
 *     BBN BitGraph.  Stephan Bechtolsheim, Bob Brown, Richard
 *     Furuta, James Schaad and Robert Wells improved it.  Norm
 *     Hutchinson ported the program to the Sun.  Neal Holtz ported
 *     it to the Apollo, and from there to producing PostScript
 *     output. Scott Jones added intelligent font substitution.
 *     Jean-Francois Lamy fixed the PostScript interface for illustrations.
 *
 */

/* Basic method:
 * Using the local font cacheing machinery that was in the previewer,
 * we can easily manage to send the bitmap for each chracter only once.
 * Two passes are made over each page in the DVI file.  The first pass
 * simply outputs the bitmaps for all characters on that page that haven't
 * been sent before.  The second pass outputs all the character setting
 * and positioning commands.  This allows us to bracket the setting portion
 * with PostScript save's and restore's, thus reclaiming considerable
 * virtual memory after each page.
 *
 * All coordinates are output in the PostScript system (TeX origin),
 * and in integer units of rasters (300/inch) -- except for character
 * widths, which are sent as floating point numbers.
 *
 * About 2 pages of PostScript support code must be sent to the LaserWriter
 * before this stuff goes.  It is automatically included unless the
 * -h option is given.
 */


/* Change log:
 *
 * Early 1985, (nmh) -- ported sun version to Apollo. 
 * A little later (nmh) -- changed to continue on in the event of missing
 *                      font files.
 * 30-Mar-85 (nmh) -- added -a option to specify a different PXL area
 * 30-Mar-85 (nmh) -- changed default PXL area to /pxl118
 * 31-Mar-85 (nmh) -- fixed bug in OpenFontFile() regarding more than MAXOPEN
 *                    PXL files -- changed to mark files as closed in font_entry.
 *  7-Apr-85 (nmh) -- made command line argument decoding case insensitive.
 *                    cleaned up handling of DVI file name argument.
 * 30-May-85 (nmh) -- new version; hacked to output PostScript commands
 *  6-Jun-85 (nmh) -- added relative positioning (20% smaller PostScript output)
 *                    add -m option to specify mag
 * 11-Jun-85 (nmh) -- fixed bug regarding char spacings in very long "words"
 * 12-Jun-85 (nmh) -- v1.02 - process DVI pages in reverse order
 * 13-Jun-85 (nmh) -- fixed bug re PXL files getting opened too often when no PreLoad
 * 14-Jun-85 (nmh) -- font dict created in PostScript only when 1st char of font downloaded
 *                    add -m0 -mh -m1 etc. to specify magsteps
 * 16-Aug-85 (nmh) -- added -c option t0 create output file in spool area (Apollo specific)
 *                    added -h option to copy header file to output
 *                    added -o option to pass options through to PostScript
 * 20-Aug-85 (nmh) -- v1.03
 * 24-Aug-85 (nmh) -- add -q option (for quiet operation).
 *                    changed -o option to check PostScript option
 *                    changed to output coordinates in TeX system (but
 *                    scaled to raster units) -- (0,0) at 1" in and down from
 *                      top left (better for use with different size paper).
 *                 -- v2.00
 * 25-Aug-85 (nmh) -- added dictionary enclosure to Tex.ps, and output
 *                      suitable prolog here.
 * 26-Aug-85 (nmh) -- changes to tex.ps to support Macintosh documents.
 * 14-Sep-85 (nmh) -- added keyword=value decoding to \special;
 * 15-Sep-85 (nmh) -- added -i file option.
 * 23-Sep-85 (saj) -- added font substitution for case when font is
 *                    unavailable at requested mag. (a frequent occurrence
 *                    with some macro packages like LaTeX)
 * 24-Jun-86 (jfl) -- Support Mac illustrations produced by LaserWriter
 *                    driver 3.0  Changed tex.ps
 *                    Added rotation for \special inclusions
 *                    Embedded ^D are ignored in included PostScript files
 */


/**********************************************************************/
/************************  Global Definitions  ************************/
/**********************************************************************/

/* This version purports to drive a PostScript device (slowly) */


typedef int BOOLEAN;
#define NEW(A) ((A *) malloc(sizeof(A)))
#define DEBUG   1			/* for massive printing of input */
					/* trace information; select by -d */
					/* option after filename: */
					/* dviview filename -d */
#ifdef DEBUG
int Debug = 0;
#endif
			  /* to enable statistics reporting via -s option */
#define STATS

#define BINARYOPEN fopen		/* byte-oriented host version */

#define ARITHRSHIFT 1                   /* define if ">>" operator is a */
					/* sign-propagating arithmetic  */
					/*   right shift */
#define USEGLOBALMAG 1			/* when defined, the dvi global */
					/*   magnification is applied   */
      
/* We can leave USEGLOBALMAG undefined when we have a limited
   number of font magnifications (at 300dpi) available.  Otherwise, we
   will simply complain about missing PXL files
 */

/* #undef USEGLOBALMAG */

			/* define for "optimal" relative postioning, rather
			   than absolute.  Relative can reduce size of postcript
			   output 20% (and reduce print time by almost as much */
#define USERELPOS 1 

#define  DVIFORMAT        2
#define  TRUE             1
#define  FALSE            0
#define  FIRSTPXLCHAR     0
#define  LASTPXLCHAR    127

#ifndef FONTAREA
#define  FONTAREA         "/usr/lib/tex/fonts"
#endif

#ifndef HDRFILE
#define HDRFILE         "/usr/lib/tex.ps"
#endif

#ifdef apollo
#ifndef SPOOLFILE
#define SPOOLFILE       "/local/spool/laser/tex."
#endif
#define MAXFLEN 28
#endif apollo

#ifdef apollo
#define  MAXOPEN         45  /* limit on number of open PXL files */
#else !apollo
#define  MAXOPEN         12  /* limit on number of open PXL files */
#endif

#define  NPXLCHARS      128
#define  PXLID         1001
#define  READ             4  /* for access() */
#define  RESOLUTION      300
#define  hconvRESOLUTION 300
#define  vconvRESOLUTION 300
#define  STACKSIZE      100
#define  STRSIZE        257
#define  NONEXISTANT     -1   /* offset for PXL files not found */
#define  NO_FILE        (FILE *)-1

#ifdef apollo           /* define for enabling of -c option (create output file) */
#define CREOPT
#endif apollo

/**********************************************************************/
/***********************  external definitions  ***********************/
/**********************************************************************/

#include "commands.h"
#include <sys/param.h>
#include <signal.h>
#include <stdio.h>
#include "findfile.h"
#include <ctype.h>

int  access();
char *index();
char *malloc();
int  free();
char *rindex();
char *sprintf();
char *strcpy(); 
char *logname();

#define EQ(a,b) (strcmp(a,b)==0)

			/* output a formatted string */
#define EMIT      fprintf
			/* output a simple string */
#define EMITS(s)  fputs(s,outfp)
			/* output an escaped octal number */
#define EMITO(c)  PutOct(c)
			/* output a decimal integer */
#define EMITN(n)  PutInt(n)
			/* output a byte value in Hex */
#define EMITH(h)  putc(*(digit+((h>>4)&0xF)),outfp),\
		  putc(*(digit+(h&0xF)),outfp)
			/* output a single character */
#define EMITC(c)  putc(c,outfp)
			/* output a scaled X dimension */
#define EMITX(x)  PutInt(PixRound(x,hconv))
			/* output a scaled Y dimension */
#define EMITY(y)  PutInt(PixRound(y,vconv))

				   /* formatted i/o was killing us, so build some tables */
char    *digit = "0123456789ABCDEF";

int dummyInt;
short dummyShort;
char dummyChar;

/**********************************************************************/
/*************************  Global Procedures  ************************/
/**********************************************************************/

/* Note: Global procedures are declared here in alphabetical order, with
   those which do not return values typed "void".  Their bodies occur in
   alphabetical order following the main() procedure.  The names are
   kept unique in the first 6 characters for portability. */

void	AbortRun();
float	ActualFactor();
void	AllDone();
FILE*	BINARYOPEN();
int     ChkOpt();               /* Check PostScript option for validity */
void    CopyFile();
void    DecodeArgs();
void    DoSpecial();
void    EmitChar();
void	Fatal();
void	FindPostAmblePtr();
void	GetBytes();
void	GetFontDef();
char   *GetKeyStr();
int     GetKeyVal();
int     HasBeenRead();
int     IsSame();
void    lcase();
char    ToLower();
void	MoveDown();
void	MoveOver();
int     NoSignExtend();         /* see cautionary note in code, re arithmetic vs logical shifts */
void	OpenFontFile();
#ifdef CREOPT
FILE*   OpenOutput();
#endif CREOPT
int	PixRound();
void    PutInt();
int	ReadFontDef();
void	ReadPostAmble();
void	SetChar();
void	SetFntNum();
void    SetPosn();
void	SetRule();
void    SetString();
int     SignExtend();           /* see cautionary note in code, re arithmetic vs logical shifts */
void	SkipFontDef();
void	Warning();


/**********************************************************************/
/***********************  Font Data Structures  ***********************/
/**********************************************************************/

struct char_entry {		/* character entry */
   unsigned short width, height;/* width and height in pixels */
   short xOffset, yOffset;      /* x offset and y offset in pixels */
   struct {
       int isloaded;
       union {
	   int fileOffset;
	   long *pixptr; } address;
       } where;
   int tfmw;			/* TFM width */
   };

struct font_entry {  /* font entry */
   int k, c, s, d, a, l;
   char n[STRSIZE];	/* FNT_DEF command parameters  */
   int font_space;	/* computed from FNT_DEF s parameter        */
   int font_mag;	/* computed from FNT_DEF s and d parameters */
   char psname[STRSIZE]; /* PostScript name of the font             */
   char name[STRSIZE];	/* full name of PXL file                    */
   FILE *font_file_id;  /* file identifier (NO_FILE if none)         */
   int magnification;	/* magnification read from PXL file         */
   int designsize;	/* design size read from PXL file           */
   struct char_entry ch[NPXLCHARS];/* character information         */
   struct font_entry *next;
   int ncdl;            /* # of different chars actually downloaded */
#ifdef STATS
   int nbpxl;           /* # of bytes of PXL data downloaded        */
   int ncts;            /* total # of characters typeset */
#endif
   };

struct pixel_list
{
    FILE *pixel_file_id;        /* file identifier                          */
    int use_count;              /* count of "opens"                         */
    };



/**********************************************************************/
/*************************  Global Variables  *************************/
/**********************************************************************/

int   FirstPage = -1000000;     /* first page to print (uses count0)   */
int   LastPage = 1000000;       /* last page to print                    */

char filename[STRSIZE];         /* DVI file name			   */

int   G_create = FALSE;         /* create an output file in spool area ?   */
int   G_errenc = FALSE;	        /* has an error been encountered?          */
int   G_header = TRUE;          /* copy header file to output?             */
char  G_Logname[STRSIZE];       /* name of log file, if created            */
int   G_interactive = FALSE;    /* is the program running interactively    */
				/* (i.e., standard output not redirected)? */
int   G_logging = 0;            /* Are we logging warning messages?        */
int   G_logfile = FALSE;        /* Are these messages going to a log file? */
FILE *G_logfp;                  /* log file pointer (for errors)           */
char  G_progname[STRSIZE];      /* program name                            */
int   G_quiet = FALSE;          /* for quiet operation                     */
int   G_nowarn = FALSE;         /* don't print out warnings                */

int   hconv, vconv;		/* converts DVI units to pixels             */
int   den;			/* denominator specified in preamble        */
FILE *dvifp  = NULL;		/* DVI file pointer                         */
int   PreLoad = TRUE;	        /* preload the font descriptions?	     */
struct font_entry *prevfont=NULL;  /* font_entry pointer, previous character */
struct font_entry *fontptr;     /* font_entry pointer                       */
struct font_entry *hfontptr=NULL;/* font_entry pointer                      */
int   h;				/* current horizontal position              */
int   hh = 0;                           /* current h on device */
char *Ifile[100];                       /* files to include */
int   v;				/* current vertical position                */
int   vv = 0;                           /* current v on device */
int   mag;			/* magnification specified in preamble      */
int   ncopies = 1;              /* number of copies to print                */
int   ndone = 0;                /* number of pages converted */
int   nif = 0;                  /* number of files to include */
int   nopen;			/* number of open PXL files                 */
int   nps = 0;                  /* number of PostScript commands to send    */
int   num;			/* numerator specified in preamble          */
#ifdef CREOPT
char  outfname[256];            /* name of output file                      */
#endif CREOPT
FILE  *outfp = NULL;            /* output file                              */
struct font_entry *pfontptr = NULL; /* previous font_entry pointer          */
struct pixel_list pixel_files[MAXOPEN+1];
				/* list of open PXL file identifiers        */
long  postambleptr;		/* Pointer to the postamble                 */
FILE *pxlfp;			/* PXL file pointer                         */
char *PXLpath;			/* PXL path name for search		    */
long  ppagep;	                /* previous page pointer		     */
char *PScmd[100];               /* PostScript commands to send              */
int   Reverse = TRUE;         /* process DVI pages in reverse order ? */
char  rootname[STRSIZE];      /* DVI filename without extension */
#ifdef STATS
int   Stats = FALSE;          /* are we reporting stats ?                 */
int   Snbpxl = 0;             /* # of bytes of pixel data                 */
int   Sonbpx = 0;             /* "optimal" number of bytes of pixel data  */
int   Sndc = 0;               /* # of different characters typeset        */
int   Stnc = 0;               /* total # of chars typeset                 */
int   Snbpx0, Sndc0, Stnc0;   /* used for printing incremental changes per dvi page */
#endif

int usermag = 0;              /* user specified magnification */

/**********************************************************************/
/*******************************  main  *******************************/
/**********************************************************************/

main(argc, argv)
int argc;
char *argv[];

{
    struct stack_entry {  /* stack entry */
	int h, v, w, x, y, z;  /* what's on stack */
    };


    int command;	    /* current command			     */
    int count[10];          /* the 10 counters at begining of each page */
    long cpagep;	    /* current page pointer		     */
    int  Emitting = FALSE;  /* are we outputting typsetting instructions? */
    register int i;	    /* command parameter; loop index	     */
    int k;		    /* temporary parameter		     */
    char n[STRSIZE];	    /* command parameter		     */
    int PassNo = 0;         /* which pass over the DVI page are we on?  */
    int SkipMode = FALSE;   /* in skip mode flag                     */
    int sp;		    /* stack pointer			     */
    struct stack_entry stack[STACKSIZE];   /* stack		     */
    int t;		    /* temporary			     */
    char SpecialStr[STRSIZE]; /* "\special" strings                  */
    register struct char_entry *tcharptr; /* temporary char_entry ptr*/
    int val, val2;          /* temporarys to hold command information*/
    int w;		    /* current horizontal spacing	     */
    int x;		    /* current horizontal spacing	     */
    int y;		    /* current vertical spacing		     */
    int z;		    /* current vertical spacing		     */

    nopen = 0;
    strcpy(G_progname, argv[0]);

    PXLpath = FONTAREA;       /* default font area */

    DecodeArgs( argc, argv );

#ifdef apollo
    set_sbrk_size( 2048*1024 );
#endif

    if ((i = NoSignExtend(dvifp, 1)) != PRE)  {
	fprintf(stderr,"\n");
	Fatal("%s: PRE doesn't occur first--are you sure this is a DVI file?\n\n",
	G_progname);
    }

    i = SignExtend(dvifp, 1);
    if (i != DVIFORMAT)  {
	fprintf(stderr,"\n");
	Fatal("%s: DVI format = %d, can only process DVI format %d files\n\n",
	G_progname, i, DVIFORMAT);
    }

#ifdef CREOPT
    if( G_create )
	outfp = OpenOutput();
    else
#endif CREOPT
	outfp = stdout;

/* it is important that these be the very first things output !!! */

    if( G_header )
	CopyFile( HDRFILE );

    for( i=0; i<nif; i++ )      /* copy all included files */
	CopyFile( Ifile[i] );

    EMIT(outfp, "TeXDict begin @start\n");
    EMIT(outfp, "%%%%Title: %s\n", filename);
    EMIT(outfp, "%%%%Creator: %s\n", G_progname);
    EMIT(outfp, "%%%%EndProlog\n");

    for( i=0; i<nps; i++ )      /* prefix valid PostScript options with a "@" */
	if( ChkOpt(PScmd[i]) )
	    EMIT(outfp, "@%s\n", PScmd[i]);
	else
	    Fatal( "%s is an invalid option\n", PScmd[i] );

    if( ncopies > 1 )
	EMIT(outfp, "%d @copies\n", ncopies);

    if (Reverse) {
	ReadPostAmble(PreLoad);
	fseek(dvifp, ppagep, 0);
	}
    else {
	if (PreLoad) {
	    ReadPostAmble(TRUE);
	    fseek(dvifp, (long) 14, 0);
	    }
	else {
	    num = NoSignExtend(dvifp, 4);
	    den = NoSignExtend(dvifp, 4);
	    mag = NoSignExtend(dvifp, 4);
#ifdef USEGLOBALMAG
	    if( usermag > 0 && usermag != mag )
		fprintf(stderr, "DVI magnification of %d over-ridden by user mag of %d\n", mag, usermag );
#endif
	    if( usermag > 0 ) mag = usermag;
#ifndef USEGLOBALMAG
	    if( mag != 1000 ) fprintf(stderr, "Magnification of %d ignored.\n", mag);
#endif
	    hconv = DoConv(num, den, hconvRESOLUTION);
	    vconv = DoConv(num, den, vconvRESOLUTION);
	    }
	k = NoSignExtend(dvifp, 1);
	GetBytes(dvifp, n, k);
	}

    PassNo = 0;
    
    while (TRUE)

	switch (command=NoSignExtend(dvifp, 1))  {

	case SET1:case SET2:case SET3:case SET4:
	    val = NoSignExtend(dvifp, command-SET1+1);
	    if (!SkipMode) SetChar(val, command, PassNo);
	    break;

	case SET_RULE:
	    val = NoSignExtend(dvifp, 4);
	    val2 = NoSignExtend(dvifp, 4);
	    if (Emitting) SetRule(val, val2, 1);
	    break;

	case PUT1:case PUT2:case PUT3:case PUT4:
	    val = NoSignExtend(dvifp,command-PUT1+1);
	    if (!SkipMode) SetChar(val, command, PassNo);
	    break;

	case PUT_RULE:
	    val = NoSignExtend(dvifp, 4);
	    val2 = NoSignExtend(dvifp, 4);
	    if (Emitting) SetRule(val, val2, 0);
	    break;

	case NOP:
	    break;

	case BOP:
	    cpagep = ftell(dvifp) - 1;
	    for (i=0; i<=9; i++)
		count[i] = NoSignExtend(dvifp, 4);
	    ppagep = NoSignExtend(dvifp, 4);

	    h = v = w = x = y = z = 0;
	    hh = vv = 0;
	    sp = 0;
	    fontptr = NULL;
	    prevfont = NULL;

	    if( count[0] < FirstPage || count[0] > LastPage )
		SkipMode = TRUE;
	    else
		SkipMode = FALSE;

	    Emitting = (PassNo != 0) && !SkipMode;

	    if( !SkipMode ) {
		if( PassNo == 0) {
			EMIT(outfp,"%d @bop0\n", count[0]);
#ifdef STATS
			if( Stats ) {
				Sndc0 = Sndc;
				Stnc0 = Stnc;
				Snbpx0 = Snbpxl;
				}
#endif
			if( !G_quiet ) 
				fprintf(stderr, "[%d", count[0] );
			}
		else
			EMIT(outfp,"%d @bop1\n", count[0]);
		}
	    break;

	case EOP:
	    if( !SkipMode ) {
		if( PassNo == 0 ) {     /* start second pass on current page */
		    fseek(dvifp,cpagep,0);
		    PassNo = 1;
		    }
		else {                  /* end of second pass, and of page processing */
		    EMIT(outfp,"@eop\n");
#ifdef STATS
		    if( Stats )
			fprintf(stderr," - %d total ch,  %d diff ch,  %d pxl bytes]\n",
				Stnc-Stnc0, Sndc-Sndc0, Snbpxl-Snbpx0);   
		    else
#endif
			if( !G_quiet ) {
				fprintf(stderr,"] ");
				if( (++ndone % 10) == 0 ) fprintf(stderr,"\n");
				}
		    PassNo = 0;
		    }
		}
	    else
		PassNo = 0;
	    if( PassNo == 0 && Reverse ) { 
		if( ppagep > 0 )
		    fseek(dvifp, ppagep, 0);
		else 
		    AllDone();
		}
	    break;

	case PUSH:
	    if (sp >= STACKSIZE)
		Fatal("stack overflow");
	    stack[sp].h = h;
	    stack[sp].v = v;
	    stack[sp].w = w;
	    stack[sp].x = x;
	    stack[sp].y = y;
	    stack[sp].z = z;
	    sp++;
	    break;

	case POP:
	    --sp;
	    if (sp < 0)
		Fatal("stack underflow");
	    h = stack[sp].h;
	    v = stack[sp].v;
	    w = stack[sp].w;
	    x = stack[sp].x;
	    y = stack[sp].y;
	    z = stack[sp].z;
	    break;

	case RIGHT1:case RIGHT2:case RIGHT3:case RIGHT4:
	    val = SignExtend(dvifp,command-RIGHT1+1);
	    if (Emitting) MoveOver(val);
	    break;

	case W0:
	    if (Emitting) MoveOver(w);
	    break;

	case W1:case W2:case W3:case W4:
	    w = SignExtend(dvifp,command-W1+1);
	    if (Emitting) MoveOver(w);
	    break;

	case X0:
	    if (Emitting) MoveOver(x);
	    break;

	case X1:case X2:case X3:case X4:
	    x = SignExtend(dvifp,command-X1+1);
	    if (Emitting) MoveOver(x);
	    break;

	case DOWN1:case DOWN2:case DOWN3:case DOWN4:
	    val = SignExtend(dvifp,command-DOWN1+1);
	    if (Emitting) MoveDown(val);
	    break;

	case Y0:
	    if (Emitting) MoveDown(y);
	    break;

	case Y1:case Y2:case Y3:case Y4:
	    y = SignExtend(dvifp,command-Y1+1);
	    if (Emitting) MoveDown(y);
	    break;

	case Z0:
	    if (Emitting) MoveDown(z);
	    break;

	case Z1:case Z2:case Z3:case Z4:
	    z = SignExtend(dvifp,command-Z1+1);
	    if (Emitting) MoveDown(z);
	    break;

	case FNT1:case FNT2:case FNT3:case FNT4:
	    if (!SkipMode) {
		SetFntNum(NoSignExtend(dvifp,command-FNT1+1), Emitting);
		}
	    break;

	case XXX1:case XXX2:case XXX3:case XXX4:
	    k = NoSignExtend(dvifp,command-XXX1+1);
	    GetBytes(dvifp, SpecialStr, k);
	    if(Emitting) DoSpecial(SpecialStr, k);
	    break;

	case FNT_DEF1:case FNT_DEF2:case FNT_DEF3:case FNT_DEF4:
	    k = NoSignExtend(dvifp, command-FNT_DEF1+1);
	    if (PreLoad || HasBeenRead(k) )
	    {
		SkipFontDef (k);
	    }
	    else
	    {
		ReadFontDef (k);
	    }
	    break;

	case PRE:
	    Fatal("PRE occurs within file");
	    break;

	case POST:
	    AllDone();
	    break;

	case POST_POST:
	    Fatal("POST_POST with no preceding POST");
	    break;

	default:
	    if (command >= FONT_00 && command <= FONT_63)
		{if (!SkipMode)
		     SetFntNum(command - FONT_00, Emitting);}
	    else if (command >= SETC_000 && command <= SETC_127)
		{if (!SkipMode) SetString(command, PassNo);}
	    else
		Fatal("%d is an undefined command", command);
	    break;

	}

}

/*-->AbortRun*/
/**********************************************************************/
/***************************  AbortRun  *******************************/
/**********************************************************************/

void
AbortRun(code)
int code;
{
    exit(code);
}


/*-->ActualFactor*/
/**********************************************************************/
/**************************  ActualFactor  ****************************/
/**********************************************************************/

float		/* compute the actual size factor given the approximation */
ActualFactor(unmodsize)
int unmodsize;  /* actually factor * 1000 */
{
    float realsize;	/* the actual magnification factor */

    realsize = (float)unmodsize / 1000.0;
    /* a real hack to correct for rounding in some cases--rkf */
    if(unmodsize==1095) realsize = 1.095445;	/*stephalf*/
    else if(unmodsize==1315) realsize=1.314534;	/*stepihalf*/
    else if(unmodsize==1577) realsize=1.577441;	/*stepiihalf*/
    else if(unmodsize==1893) realsize=1.892929;	/*stepiiihalf*/
    else if(unmodsize==2074) realsize=2.0736;	/*stepiv*/
    else if(unmodsize==2488) realsize=2.48832;  /*stepv*/
    else if(unmodsize==2986) realsize=2.985984;	/*stepiv*/
    /* the remaining magnification steps are represented with sufficient
	   accuracy already */
    return(realsize);
}


/*-->AllDone*/
/**********************************************************************/
/****************************** AllDone  ******************************/
/**********************************************************************/

void
AllDone()
{
    char t;
    struct font_entry *p;
    int per;

    EMIT(outfp,"@end\n");
    if( !G_quiet ) fprintf(stderr,"\n");

#ifdef CREOPT
    if( G_create ) {
	fclose(outfp);
	if( !G_quiet ) fprintf(stderr, "Output written on \"%s\"\n", outfname );
	}
#endif CREOPT

    if (G_errenc && G_logging == 1 && G_logfile)  {
	fseek(G_logfp, 0, 0);
	while ((t=getc(G_logfp)) != EOF)
	    putchar(t);
    }
    if (G_logging == 1 && G_logfile) printf("Log file created\n");

#ifdef STATS
    if (Stats) {
	fprintf( stderr, "Total chars   diff chars   pxl bytes\n" );
	fprintf( stderr, "      #   %%        #   %%       #   %%\n" );
	fprintf( stderr, "------- ---   ------ ---   ----- ---\n" );
	for( p=hfontptr; p!=NULL; p=p->next ) {
		fprintf( stderr, "%7d%4d", p->ncts, (100*p->ncts + Stnc/2)/Stnc );
		fprintf( stderr, "%9d%4d", p->ncdl, (100*p->ncdl + Sndc/2)/Sndc );
		fprintf( stderr, "%8d%4d", p->nbpxl, (100*p->nbpxl + Snbpxl/2)/Snbpxl );
		fprintf( stderr, "  %s\n", p->psname );
		}
	fprintf(stderr, "\nTotal number of characters typeset: %d\n", Stnc);
	fprintf(stderr, "Number of different characters downloaded: %d\n", Sndc);
	fprintf(stderr, "Number of bytes of pxl data downloaded: %d\n", Snbpxl);
	fprintf(stderr, "Optimal # of bytes of pxl data: %d\n", Sonbpx);
	}
#endif

    AbortRun(G_errenc);
}


/*-->ChkOpt*/   /* check a user supplied option for validity */
/*********************************************************************/
/****************************** ChkOpt *******************************/
/*********************************************************************/

#define ISOPT(s) if( EQ(str,s) ) return( TRUE )

int
ChkOpt( str )
char    *str;
{
	lcase(str);

	ISOPT("note");         /* its a shame to build this into the program */
	ISOPT("letter");
	ISOPT("legal");
	ISOPT("landscape");
	ISOPT("manualfeed");
	ISOPT("envelope");
	return( FALSE );
}


/*-->CopyFile*/   /* copy a file straight through to output */
/*********************************************************************/
/***************************** CopyFile ******************************/
/*********************************************************************/

void
CopyFile( str )
char    *str;
{
	FILE    *spfp;
	char    t;

	if( (spfp=fopen(str,"r")) == NULL ) {
		fprintf(stderr,"Unable to open file %s\n", str );
		return;
		}
	if( !G_quiet ) fprintf(stderr," [%s", str);
	while( (t = getc(spfp)) != EOF ) {
		if ( t != '\004' )
		    EMITC(t);
		}              
	fclose(spfp);
	if( !G_quiet ) fprintf(stderr,"]");
}


/*-->DecodeArgs*/
/*********************************************************************/
/***************************** DecodeArgs ****************************/
/*********************************************************************/

void
DecodeArgs( argc, argv )
int argc;
char *argv[];
{
    int argind;             /* argument index for flags              */
    char curarea[STRSIZE];  /* current file area		     */
    char curname[STRSIZE];  /* current file name		     */
    char *tcp, *tcp1;	    /* temporary character pointers	     */

    argind = 1;
    while (argind < argc) {
	tcp = argv[argind];
	if (*tcp == '-')
	    switch(isupper(*++tcp) ? (*tcp-'A')+'a' : *tcp) {

		case 'a':       /* a selects different pxl font area */
		    PXLpath = argv[++argind];
		    break;
#ifdef CREOPT
		case 'c':       /* create an output file in spool area */
		    G_create = TRUE;
		    break;
#endif CREOPT
#ifdef DEBUG
		case 'd':	/* d selects Debug output */
		    Debug = TRUE;
		    break;
#endif
		case 'f':       /* next arg is starting pagenumber */
		    if( ++argind >= argc || sscanf(argv[argind], "%d", &FirstPage) != 1 )
			Fatal("Argument is not a valid integer\n", 0);
		    break;

		case 'h':       /* don't copy PostScript header file through to output */
		    G_header = FALSE;
		    break;

		case 'i':       /* next arg is a PostScript file to copy */
		    if( ++argind >= argc )
			Fatal("No argument following -i\n", 0);
		    Ifile[nif++] = argv[argind];
		    break;

		case 'l':	/* l prohibits logging of errors */
		    G_logging = -1;
		    break;
#ifdef USEGLOBALMAG
		case 'm':       /* specify magnification to use */
		    switch( ToLower(*++tcp) ) {

		    case '\0':       /* next arg is a magnification to use */
			if( ++argind >= argc || sscanf(argv[argind], "%d", &usermag) != 1 )
			    Fatal("Argument is not a valid integer\n", 0);
			break; 
		    case '0': usermag = 1000; break;
		    case 'h': usermag = 1095; break;
		    case '1': usermag = 1200; break;
		    case '2': usermag = 1440; break;
		    case '3': usermag = 1728; break;
		    case '4': usermag = 2074; break;
		    case '5': usermag = 2488; break;
		    default: Fatal("%c is a bad mag step\n", *tcp);
		    }
		    break;
#endif
		case 'n':       /* next arg is number of copies to print */
		    if( ++argind >= argc || sscanf(argv[argind], "%d", &ncopies) != 1 )
			Fatal("Argument is not a valid integer\n", 0);
		    break;    

		case 'o':       /* next arg is a PostScript command to send */
		    if( ++argind >= argc )
			Fatal("No argument following -o\n", 0);
		    PScmd[nps++] = argv[argind];
		    break;

		case 'p':	/* p prohibits pre-font loading */
		    PreLoad = 0;
		    Reverse = FALSE;    /* must then process in forward order */
		    break;

		case 'q':       /* quiet operation */
		    G_quiet = TRUE;
		    break;

		case 'r':       /* don't process pages in reverse order */
		    Reverse = FALSE;
		    break;
#ifdef STATS                   
		case 's':       /* print some statistics */
		    Stats = TRUE;
		    break;
#endif
		case 't':       /* next arg is ending pagenumber */
		    if( ++argind >= argc || sscanf(argv[argind], "%d", &LastPage) != 1 )
			Fatal("Argument is not a valid integer\n", 0);
		    break;

		case 'w':       /* don't print out warnings */
		    G_nowarn = TRUE;
		    break;

		default:
		    printf("%c is not a legal flag\n", *tcp);
		}

	else {

	    tcp = rindex(argv[argind], '/');    /* split into directory + file name */
	    if (tcp == NULL)  {
		curarea[0] = '\0';
		tcp = argv[argind];
		}
	    else  {
		strcpy(curarea, argv[argind]);
		curarea[tcp-argv[argind]+1] = '\0';
		tcp += 1;
		}
	
	    strcpy(curname, tcp);
	    tcp1 = rindex(tcp, '.');   /* split into file name + extension */
	    if (tcp1 == NULL) {
		strcpy(rootname, curname);
		strcat(curname, ".dvi");
		}
	    else {
		*tcp1 = '\0';
		strcpy(rootname, curname);
		*tcp1 = '.';
		}
	
	    strcpy(filename, curarea);
	    strcat(filename, curname);
	
	    if ((dvifp=BINARYOPEN(filename,"r")) == NULL)  {
		fprintf(stderr,"\n");
		fprintf(stderr,"%s: can't find DVI file \"%s\"\n\n", G_progname, filename);
		AbortRun(1);
		}
	
	    strcpy(G_Logname, curname);
	    strcat(G_Logname, ".log");
	    }
	argind++;
	}

    if (dvifp == NULL)  {
	fprintf(stderr, 
		"\nusage: %s [-a area] [-c] [-h] [-o option] [-p] [-s] [-r] [-f n] [-t n] [-m{0|h|1|2|3|4|  mag] [-a fontarea] dvifile\n\n", 
		G_progname);
	AbortRun(1);
	}
}


/*-->DoConv*/
/*********************************************************************/
/********************************  DoConv  ***************************/
/*********************************************************************/

int DoConv(num, den, convResolution)
{
    register float conv;
    conv = ((float)num/(float)den) * 
#ifdef USEGLOBALMAG
/*	ActualFactor(mag) * why was this in as Actual Factor?  jls */
	((float) mag/1000.0) *
#endif
	((float)convResolution/254000.0);
    return((int) (1.0 / conv + 0.5));
}


/*-->DoSpecial*/
/*********************************************************************/
/*****************************  DoSpecial  ***************************/
/*********************************************************************/

typedef enum {None, String, Integer, Number, Dimension} ValTyp;

typedef struct {
	char    *Key;           /* the keyword string */
	char    *Val;           /* the value string */
	ValTyp  vt;             /* the value type */
	union {                 /* the decoded value */
	    int  i;
	    float n;
	    } v;
	} KeyWord;

typedef struct {
	char    *Entry;
	ValTyp  Type;
	} KeyDesc;

#define PSFILE 0
KeyDesc KeyTab[] = {{"psfile", String},
		    {"hsize", Dimension},
		    {"vsize", Dimension},
		    {"hoffset", Dimension},
		    {"voffset", Dimension},
		    {"hscale", Number},
		    {"vscale", Number},
		    {"rotation", Dimension}};

#define NKEYS (sizeof(KeyTab)/sizeof(KeyTab[0]))

void
DoSpecial( str, n )          /* interpret a \special command, made up of keyword=value pairs */
char    *str;
int n;
{ 
	char spbuf[STRSIZE]; 
	char *sf = NULL;
	KeyWord k;
	int i;

	str[n] = '\0';
	spbuf[0] = '\0';

	SetPosn(h, v);
	EMITS("@beginspecial\n");

	while( (str=GetKeyStr(str,&k)) != NULL ) {      /* get all keyword-value pairs */
			      /* for compatibility, single words are taken as file names */
		if( k.vt == None && access(k.Key,0) == 0) {
			if( sf ) Warning("  More than one \\special file name given. %s ignored", sf );
			strcpy(spbuf, k.Key);
			sf = spbuf;
			}
		else if( GetKeyVal( &k, KeyTab, NKEYS, &i ) && i != -1 ) {
			if( i == PSFILE ) {
				if( sf ) Warning("  More than one \\special file name given. %s ignored", sf );
				strcpy(spbuf, k.Val);
				sf = spbuf;
				}
			else            /* the keywords are simply output as PS procedure calls */
				EMIT(outfp, "%f @%s\n", k.v.n, KeyTab[i].Entry);
			}
		else Warning("  Invalid keyword or value in \\special - \"%s\" ignored", k.Key );
		}

	EMITS("@setspecial\n");

	if( sf )
		CopyFile( sf );
	else
		Warning("  No special file name provided.");

	EMITS("@endspecial\n");
}


/*-->EmitChar*/
/**********************************************************************/
/****************************  EmitChar  ******************************/
/**********************************************************************/


void
EmitChar(c, ce)              /* output a character bitmap */
int c;
struct char_entry *ce;
{
	int i;
	register int j;
	register unsigned char *sl;
	register int cc;
	int nbpl, nwpl;
	float cw;       /* char width, in "dots" - we rely on PostScript maintaining sufficient accuracy */

			/* Output in PostScript coord system (y +ive up, x +ive right)
			   (0,0) of char bitmap at lower left.  Output scan lines
			   from bottom to top */

	if( fontptr->ncdl == 0 )      /* open font dict before first char */
		EMIT(outfp,"[ %d ] /%s @newfont\n", fontptr->font_mag, fontptr->psname );
 
	if( fontptr != prevfont ) {   /* because this isn't done on pass 0 */
		EMIT(outfp,"%s @sf\n", fontptr->psname);
		prevfont = fontptr;
		}
	EMITS("[<");
	cc = 2;
	nbpl = (ce->width + 7) >> 3;
	nwpl = (ce->width + 31) >> 5;
	for(i = ce->height-1;  i >= 0;  i--) {
		sl = (unsigned char *)(ce->where.address.pixptr + i*nwpl);
		for(j = 0;  j < nbpl;  j++, sl++) {
			if( cc > 100 ) {
				EMITS("\n  ");   cc = 2; }
			EMITH(*sl);
			cc += 2;
			}
		}
	cw = (float)ce->tfmw / (float)hconv;
	EMIT(outfp,"> %d %d %d %d %.3f] %d @dc\n", 
	     nbpl<<3, ce->height, ce->xOffset, (((int)ce->height)-ce->yOffset)-1, cw,
	     c);
	fontptr->ncdl += 1;

#ifdef STATS
	Snbpxl += nbpl*ce->height;
	fontptr->nbpxl += nbpl*ce->height;
	Sonbpx += (ce->width*ce->height + 7) >> 3;
	Sndc += 1;
#endif
}


/*-->Fatal*/
/**********************************************************************/
/******************************  Fatal  *******************************/
/**********************************************************************/

void
Fatal(fmt, a, b, c)/* issue a fatal error message */
char *fmt;	/* format */
char *a, *b, *c;	/* arguments */

{
    if (G_logging == 1 && G_logfile)
    {
	fprintf(G_logfp, "%s: FATAL--", G_progname);
	fprintf(G_logfp, fmt, a, b, c);
	fprintf(G_logfp, "\n");
    }

    fprintf(stderr,"\n");
    fprintf(stderr, "%s: FATAL--", G_progname);
    fprintf(stderr, fmt, a, b, c);
    fprintf(stderr, "\n\n");
    if (G_logging == 1) printf("Log file created\n");
#ifdef CREOPT
    if (G_create && outfp != NULL) {
	fclose(outfp);
	unlink(outfname);
	}
#endif CREOPT
    AbortRun(1);
}


/*-->FindPostAmblePtr*/
/**********************************************************************/
/************************  FindPostAmblePtr  **************************/
/**********************************************************************/

void
FindPostAmblePtr(postambleptr)
long	*postambleptr;

/* this routine will move to the end of the file and find the start
    of the postamble */

{
    int     i;

    fseek (dvifp, (long) 0, 2);   /* goto end of file */
    *postambleptr = ftell (dvifp) - 4;
    fseek (dvifp, *postambleptr, 0);

    while (TRUE) {
	fseek (dvifp, --(*postambleptr), 0);
	if (((i = NoSignExtend(dvifp, 1)) != 223) &&
	    (i != DVIFORMAT))
	    Fatal ("Bad end of DVI file");
	if (i == DVIFORMAT)
	    break;
    }
    fseek (dvifp, (*postambleptr) - 4, 0);
    (*postambleptr) = NoSignExtend(dvifp, 4);
    fseek (dvifp, *postambleptr, 0);
}


/*-->GetBytes*/
/**********************************************************************/
/*****************************  GetBytes  *****************************/
/**********************************************************************/

void
GetBytes(fp, cp, n)	/* get n bytes from file fp */
register FILE *fp;	/* file pointer	 */
register char *cp;	/* character pointer */
register int n;		/* number of bytes  */

{
    while (n--)
	*cp++ = getc(fp);
}


/*-->GetFontDef*/
/**********************************************************************/
/**************************** GetFontDef  *****************************/
/**********************************************************************/

void
GetFontDef()

/***********************************************************************
   Read the font  definitions as they  are in the  postamble of the  DVI
   file.
***********************************************************************/

{
    char    str[50], *calloc ();
    unsigned char   byte;
    int     i, fnamelen;

    while (((byte = NoSignExtend(dvifp, 1)) >= FNT_DEF1) &&
	(byte <= FNT_DEF4)) {
	switch (byte) {
	case FNT_DEF1:
	    ReadFontDef (NoSignExtend(dvifp, 1));
	    break;
	case FNT_DEF2:
	    ReadFontDef (NoSignExtend(dvifp, 2));
	    break;
	case FNT_DEF3:
	    ReadFontDef (NoSignExtend(dvifp, 3));
	    break;
	case FNT_DEF4:
	    ReadFontDef (NoSignExtend(dvifp, 4));
	    break;
	default:
	    Fatal ("Bad byte value in font defs");
	    break;
	}
    }
    if (byte != POST_POST)
	Fatal ("POST_POST missing after fontdefs");
}


/*-->GetKeyStr*/
/**********************************************************************/
/*****************************  GetKeyStr  ****************************/
/**********************************************************************/

	/* extract first keyword-value pair from string (value part may be null)
	 * return pointer to remainder of string
	 * return NULL if none found
	 */

char    KeyStr[STRSIZE];
char    ValStr[STRSIZE];

char *GetKeyStr( str, kw )
char    *str;
KeyWord *kw;
{
	char *s, *k, *v, t;

	if( !str ) return( NULL );

	for( s=str; *s == ' '; s++ ) ;                  /* skip over blanks */
	if( *s == '\0' ) return( NULL );

	for( k=KeyStr;                          /* extract keyword portion */
	     *s != ' ' && *s != '\0' && *s != '='; 
	     *k++ = *s++ ) ;
	*k = '\0';
	kw->Key = KeyStr;
	kw->Val = v = NULL;
	kw->vt = None;

	for( ; *s == ' '; s++ ) ;                       /* skip over blanks */
	if( *s != '=' )                         /* look for "=" */
		return( s );

	for( s++ ; *s == ' '; s++ ) ;                   /* skip over blanks */
	if( *s == '\'' || *s == '\"' )          /* get string delimiter */
		t = *s++;
	else
		t = ' ';
	for( v=ValStr;                          /* copy value portion up to delim */
	     *s != t && *s != '\0';
	     *v++ = *s++ ) ;
	if( t != ' ' && *s == t ) s++;
	*v = '\0';
	kw->Val = ValStr;
	kw->vt = String;

	return( s );
}


/*-->GetKeyVal*/
/**********************************************************************/
/*****************************  GetKeyVal  ****************************/
/**********************************************************************/

	/* get next keyword-value pair
	 * decode value according to table entry
	 */

int GetKeyVal( kw, tab, nt, tno)
KeyWord *kw; 
KeyDesc tab[];
int     nt;
int     *tno;
{
	int i;
	char c = '\0';

	*tno = -1;

	for(i=0; i<nt; i++)
		if( IsSame(kw->Key, tab[i].Entry) ) {
			*tno = i;
			switch( tab[i].Type ) {
				case None: 
					if( kw->vt != None ) return( FALSE );
					break;
				case String:
					if( kw->vt != String ) return( FALSE );
					break;
				case Integer:
					if( kw->vt != String ) return( FALSE );
					if( sscanf(kw->Val,"%d%c", &(kw->v.i), &c) != 1
					    || c != '\0' ) return( FALSE );
					break;
				case Number:
				case Dimension:
					if( kw->vt != String ) return( FALSE );
					if( sscanf(kw->Val,"%f%c", &(kw->v.n), &c) != 1
					    || c != '\0' ) return( FALSE );
					break;
				}
			kw->vt = tab[i].Type;
			return( TRUE );
			}

	return( TRUE );
}


/*-->HasBeenRead*/
/**********************************************************************/
/***************************  HasBeenRead  ****************************/
/**********************************************************************/

int
HasBeenRead(k)
int k;
{
    struct font_entry *ptr;

    ptr = hfontptr;
    while ((ptr!=NULL) && (ptr->k!=k))
	ptr = ptr->next;
    return( ptr != NULL );
}


/*-->IsSame*/
/**********************************************************************/
/*******************************  IsSame  *****************************/
/**********************************************************************/

int IsSame(a, b)        /* compare strings, ignore case */
char *a, *b;
{
	for( ; *a != '\0'; )
		if( ToLower(*a++) != ToLower(*b++) ) return( FALSE );
	return( *a == *b ? TRUE : FALSE );
}


/*-->lcase*/
/**********************************************************************/
/****************************  lcase  *********************************/
/**********************************************************************/

void lcase(s)
char *s;
{
	char *t;
	for(t=s; *t != '\0'; t++)
	  *t = ToLower(*t);
	return;
}

/*-->ToLower*/
/**********************************************************************/
/**************************** ToLower *********************************/
/**********************************************************************/

char ToLower(c)
char c;
{
       return( isupper(c)?tolower(c):c );
}

/*-->MoveDown*/
/**********************************************************************/
/****************************  MoveDown  ******************************/
/**********************************************************************/

void
MoveDown(a)
int a;
{
    v += a;
}


/*-->MoveOver*/
/**********************************************************************/
/****************************  MoveOver  ******************************/
/**********************************************************************/

void
MoveOver(b)
int b;
{
    h += b;
}


/*-->NoSignExtend*/
/**********************************************************************/
/***************************  NoSignExtend  ***************************/
/**********************************************************************/

int
NoSignExtend(fp, n)	/* return n byte quantity from file fd */
register FILE *fp;	/* file pointer    */
register int n;		/* number of bytes */

{
    register int x;	/* number being constructed */

    x = 0;
    while (n--)  {
	x <<= 8;
	x |= getc(fp);
    }
    return(x);
}


/*-->OpenFontFile*/
/**********************************************************************/
/************************** OpenFontFile  *****************************/
/**********************************************************************/

void
OpenFontFile()
/***********************************************************************
    The original version of this dvi driver reopened the font file  each
    time the font changed, resulting in an enormous number of relatively
    expensive file  openings.   This version  keeps  a cache  of  up  to
    MAXOPEN open files,  so that when  a font change  is made, the  file
    pointer, pxlfp, can  usually be  updated from the  cache.  When  the
    file is not found in  the cache, it must  be opened.  In this  case,
    the next empty slot  in the cache  is assigned, or  if the cache  is
    full, the least used font file is closed and its slot reassigned for
    the new file.  Identification of the least used file is based on the
    counts of the number  of times each file  has been "opened" by  this
    routine.  On return, the file pointer is always repositioned to  the
    beginning of the file.

***********************************************************************/
{
    register int i,least_used,current;

#ifdef DEBUG
    if (Debug) printf("Open Font file\n");
#endif
    if (pfontptr == fontptr)
	return;                 /* we need not have been called */

    for (current = 1;
	(current <= nopen) &&
	    (pixel_files[current].pixel_file_id != fontptr->font_file_id);
	++current)
	;                       /* try to find file in open list */

    if (current <= nopen)       /* file already open */
    {
	if( (pxlfp = pixel_files[current].pixel_file_id) != NO_FILE )
		fseek(pxlfp,0,0);	/* reposition to start of file */
    }
    else                        /* file not in open list */
    {
	if (nopen < MAXOPEN)    /* just add it to list */
	    current = ++nopen;
	else                    /* list full -- find least used file, */
	{                       /* close it, and reuse slot for new file */
	    least_used = 1;
	    for (i = 2; i <= MAXOPEN; ++i)
		if (pixel_files[least_used].use_count >
		    pixel_files[i].use_count)
		    least_used = i;
	    if (pixel_files[least_used].pixel_file_id != NO_FILE) {
		FILE *fid;
		struct font_entry *fp;

		fid = pixel_files[least_used].pixel_file_id;
		fp=hfontptr;    /* mark file as being closed in the entry */
		while (fp!=NULL && fp->font_file_id != fid) 
			fp = fp->next;
		if (fp==NULL)
		  Fatal("Open file %x not found in font entry list.\n", fid);
		else {
			fp->font_file_id = NULL;
#ifdef STATS
			if (Stats)
				fprintf(stderr, "PXL file %s closed.\n", fp->name);
#endif
			}
		fclose( fid );
		}
	    current = least_used;
	}
	if ((pxlfp=BINARYOPEN(fontptr->name,"r")) == NULL) {
	    Warning("PXL file %s could not be opened",fontptr->name);
	    pxlfp = NO_FILE;
	    }
	else {
#ifdef STATS
	    if (Stats) 
		fprintf(stderr, "PXL file %s opened.\n", fontptr->name);
#endif
	    }
	pixel_files[current].pixel_file_id = pxlfp;
	pixel_files[current].use_count = 0;
    }
    pfontptr = fontptr;			/* make previous = current font */
    fontptr->font_file_id = pxlfp;	/* set file identifier */
    pixel_files[current].use_count++;	/* update reference count */
}

#ifdef CREOPT
/*-->OpenOutput*/   /* generate a unique file name and open it */
/**********************************************************************/
/*************************** OpenOutput *******************************/
/**********************************************************************/


FILE*
OpenOutput()
{
	FILE*   fp;
	long t;
	int  n = 0;
	char *p, *pp, b[256];
	int nd;

	time( &t );
	t = t % 100000;
	strcpy( outfname, SPOOLFILE );
	sprintf( b, "%s.%s.%x", logname(), rootname, t );
	if( (nd=strlen(b)-MAXFLEN) > 0 ) {
	       for(pp=(p=rindex(b,'.')); p && *p != '\0'; *(pp-nd) = *p++, pp++) ;
	       *(pp-nd) = '\0';
	       }
	strcat( outfname, b );

	while( access(outfname,0) == 0 ) {
		n += 1;
		if( n > 10 ) 
			Fatal( "Unable to create a unique output file name: %s\n", outfname );
		strcpy( outfname, SPOOLFILE );
		sprintf( b, "%s.%s.%x.%d", logname(), rootname, t, n );
		if( (nd=strlen(b)-MAXFLEN) > 0 ) {
			for(pp=(p=rindex(b,'.')); p && *p != '\0'; *(pp-nd) = *p++, pp++) ;
			*(pp-nd) = '\0';
			}
		strcat( outfname, b );
		}

	if( (fp=fopen(outfname,"w")) == NULL )
		Fatal("Unable to create output file: %s\n", outfname);

	return( fp );
}
#endif CREOPT

/*-->PixRound*/
/**********************************************************************/
/*****************************  PixRound  *****************************/
/**********************************************************************/

int
PixRound(x, conv)	/* return rounded number of pixels */
register int x;		/* in DVI units     */
int conv;		/* conversion factor */
{
    return((int)((x + (conv >> 1)) / conv));
}


/*-->PutInt*/
/**********************************************************************/
/*****************************  PutInt  *******************************/
/**********************************************************************/

void
PutInt(n)               /* output an integer followed by a space */
register int n;
{
    char buf[10];
    register char *b;

    if( n == 0 )
	EMITC('0'); 
    else {
	if( n < 0 ) {
	    EMITC('-');
	    n = -n;
	    }
    
	for(b=buf;  n>0;  ) {
	    *b++ = digit[n%10];
	    n /= 10;
	    }
    
	for( ; b>buf; )
	    EMITC(*--b);
	}

    EMITC(' ');
}


/*-->PutOct*/
/**********************************************************************/
/*****************************  PutOct  *******************************/
/**********************************************************************/

void
PutOct(n)               /* output an 3 digit octal number preceded by a "\" */
register int n;
{                  
    EMITC( '\\' ); 
    EMITC( digit[(n&0300)>>6] );
    EMITC( digit[(n&0070)>>3] ); 
    EMITC( digit[n&0007] );
}


/*-->ReadFontDef*/
/**********************************************************************/
/****************************  ReadFontDef  ***************************/
/**********************************************************************/

int
ReadFontDef(k)
int k;
{
    int t, i;
    register struct font_entry *tfontptr;/* temporary font_entry pointer   */
    register struct char_entry *tcharptr;/* temporary char_entry pointer  */
    char *direct, *tcp, *tcp1;
    int found;
    char curarea[STRSIZE];
    int cmag;
    int nmag;
    char nname[128];

    if ((tfontptr = NEW(struct font_entry)) == NULL)
	Fatal("can't malloc space for font_entry");
    tfontptr->next = hfontptr;
    tfontptr->font_file_id = NULL;
    fontptr = hfontptr = tfontptr;

    tfontptr->ncdl = 0;
#ifdef STATS
    tfontptr->nbpxl = 0;
    tfontptr->ncts = 0;
#endif

    tfontptr->k = k;
    tfontptr->c = NoSignExtend(dvifp, 4); /* checksum */
    tfontptr->s = NoSignExtend(dvifp, 4); /* space size */
    tfontptr->d = NoSignExtend(dvifp, 4); /* design size */
    tfontptr->a = NoSignExtend(dvifp, 1); /* area length for font name */
    tfontptr->l = NoSignExtend(dvifp, 1); /* device length */
    GetBytes(dvifp, tfontptr->n, tfontptr->a+tfontptr->l);
    tfontptr->n[tfontptr->a+tfontptr->l] = '\0';
    tfontptr->font_space = tfontptr->s/6; /* never used */
    tfontptr->font_mag = (int)((ActualFactor((int)(((float)tfontptr->s/
			(float)tfontptr->d)*1000.0 + 0.5)) * 
#ifdef USEGLOBALMAG
			ActualFactor(mag) *
#endif
			(float)RESOLUTION * 5.0) + 0.5);

    if (!findfile(&PXLpath,1,"",tfontptr->n,tfontptr->font_mag,tfontptr->name,
		  nname, &nmag))
      Fatal("no font %s.%d",tfontptr->n,mag);
      
    sprintf(tfontptr->psname, "%s.%d", tfontptr->n, tfontptr->font_mag);
    if (tfontptr != pfontptr)
	OpenFontFile();
    if ( pxlfp == NO_FILE ) {                /* allow missing pxl files */
	tfontptr->magnification = 0;
	tfontptr->designsize = 0;
	for (i = FIRSTPXLCHAR; i <= LASTPXLCHAR; i++) {
	    tcharptr = &(tfontptr->ch[i]);
	    tcharptr->width = 0;
	    tcharptr->height = 0;
	    tcharptr->xOffset= 0;
	    tcharptr->yOffset = 0;
	    tcharptr->where.isloaded = FALSE;
	    tcharptr->where.address.fileOffset = NONEXISTANT;
	    tcharptr->tfmw = 0;
	    }
	return;
	}

    if ((t = NoSignExtend(pxlfp, 4)) != PXLID)
	Fatal("PXL ID = %d, can only process PXL ID = %d files",
	      t, PXLID);
    fseek(pxlfp, -20, 2);
    t = NoSignExtend(pxlfp, 4);
    if ((tfontptr->c != 0) && (t != 0) && (tfontptr->c != t))
	Warning("font = \"%s\",\n-->font checksum = %d,\n-->dvi checksum = %d",
		tfontptr->name, tfontptr->c, t);
    tfontptr->magnification = NoSignExtend(pxlfp, 4);
    tfontptr->designsize = NoSignExtend(pxlfp, 4);

    fseek(pxlfp, NoSignExtend(pxlfp, 4) * 4, 0);

    for (i = FIRSTPXLCHAR; i <= LASTPXLCHAR; i++) {
	tcharptr = &(tfontptr->ch[i]);
	tcharptr->width = NoSignExtend(pxlfp, 2);
	tcharptr->height = NoSignExtend(pxlfp, 2);
	tcharptr->xOffset= SignExtend(pxlfp, 2);
	tcharptr->yOffset = SignExtend(pxlfp, 2);
	tcharptr->where.isloaded = FALSE;
	tcharptr->where.address.fileOffset = NoSignExtend(pxlfp, 4) * 4;
	tcharptr->tfmw = ((float)NoSignExtend(pxlfp, 4)*(float)tfontptr->s) /
	    (float)(1<<20);
    }
}


/*-->ReadPostAmble*/
/**********************************************************************/
/**************************  ReadPostAmble  ***************************/
/**********************************************************************/

void
ReadPostAmble(load)
int     load;
/***********************************************************************
    This  routine  is  used  to  read  in  the  postamble  values.    It
    initializes the magnification and checks  the stack height prior  to
    starting printing the document.
***********************************************************************/
{
    FindPostAmblePtr (&postambleptr);
    if (NoSignExtend(dvifp, 1) != POST)
	Fatal ("POST missing at head of postamble");
#ifdef DEBUG
    if (Debug) fprintf (stderr, "got POST command\n");
#endif
    ppagep = NoSignExtend(dvifp, 4);
    num = NoSignExtend(dvifp, 4);
    den = NoSignExtend(dvifp, 4);
    mag = NoSignExtend(dvifp, 4);
#ifdef USEGLOBALMAG
    if( usermag > 0 && usermag != mag )
	fprintf(stderr, "DVI magnification of %d over-ridden by user mag of %d\n", mag, usermag );
#endif
    if( usermag > 0 ) mag = usermag;
#ifndef USEGLOBALMAG
    if( mag != 1000 ) fprintf(stderr, "Magnification of %d ignored.\n", mag);
#endif
    hconv = DoConv(num, den, hconvRESOLUTION);
    vconv = DoConv(num, den, vconvRESOLUTION);

    NoSignExtend(dvifp, 4);	/* height-plus-depth of tallest page */
    NoSignExtend(dvifp, 4);	/* width of widest page */
    if (NoSignExtend(dvifp, 2) >= STACKSIZE)
	Fatal ("Stack size is too small");
    NoSignExtend(dvifp, 2);	/* this reads the number of pages in */
    /* the DVI file */
#ifdef DEBUG
    if (Debug) fprintf (stderr, "now reading font defs");
#endif
    if (load) GetFontDef ();
}


/*-->SetChar*/
/**********************************************************************/
/*****************************  SetChar  ******************************/
/**********************************************************************/

int buffer[8];

LoadAChar(c, ptr)
int c;
register struct char_entry *ptr;
{
    long *pr;
    register int nints;

    if (ptr->where.address.fileOffset == NONEXISTANT) {
	ptr->where.address.pixptr = NULL;
	ptr->where.isloaded = TRUE;
	return;
	}

    OpenFontFile();
    fseek(pxlfp, ptr->where.address.fileOffset, 0);
    nints = ((ptr->width + 31) >> 5) * ptr->height;
    if( (pr = (long *)malloc( nints*sizeof(long) )) == NULL )
	Fatal("Unable to allocate memory for char\n");
    fread(pr, 4, nints, pxlfp);
    ptr->where.address.pixptr = pr;
    ptr->where.isloaded = TRUE;

    EmitChar(c, ptr);
	/* we should really free the space used by the PXL data after this
	   point, but it is not large, and besides, we may want to be
	   more clever in the future, about sending bitmaps.  So keep
	   the data around */
}

void
SetChar(c, command, PassNo)
int c, command, PassNo;
{
    register struct char_entry *ptr;  /* temporary char_entry pointer */
    int k;

    ptr = &(fontptr->ch[c]);
    if (!ptr->where.isloaded) LoadAChar(c, ptr);
    if (PassNo==0) return;

    SetPosn(h,v);
    if (fontptr->font_file_id != NO_FILE) {      /* ignore missing fonts */
	EMITN(c); EMITS("c\n");
	hh += ptr->tfmw;
	}

    if (command <= SET4)
	h += ptr->tfmw;

#ifdef STATS
    Stnc += 1;
    fontptr->ncts += 1;
#endif
}


/*-->SetFntNum*/
/**********************************************************************/
/****************************  SetFntNum  *****************************/
/**********************************************************************/

void
SetFntNum(k, Emitting)
int k, Emitting;

/*  this routine is used to specify the font to be used in printing future
    characters */

{
    fontptr = hfontptr;
    while ((fontptr!=NULL) && (fontptr->k!=k))
	fontptr = fontptr->next;
    if (fontptr == NULL)
	Fatal("font %d undefined", k);
    if (Emitting && (fontptr->font_file_id != NO_FILE) ) 
	EMIT(outfp,"%s @sf\n", fontptr->psname);
}


/*-->SetPosn*/
/**********************************************************************/
/*****************************  SetPosn  ******************************/
/**********************************************************************/

void
SetPosn(x, y)           /* output a positioning command */
int x, y;
{
	int rx,ry;
#ifdef USERELPOS
	if (y == vv) {  /* use relative movement if just moving horizontally */
	    if ( x != hh ) {
		EMITN(rx=PixRound(x-hh,hconv));
		EMITS("r ");
		hh += rx*hconv;
		}
	    }
	else {
#endif
	    EMITN(rx=PixRound(x,hconv));
	    EMITN(ry=PixRound(y,vconv));
	    EMITS("p ");
	    hh = rx*hconv;      /* must know where device "really" is horizontally, for rel. posning. */
	    vv = y;             /* but we always use direct positioning for vertical movement */
#ifdef USERELPOS
	    }
#endif
}


/*-->SetRule*/
/**********************************************************************/
/*****************************  SetRule  ******************************/
/**********************************************************************/

void
SetRule(a, b, Set)
int a, b;
BOOLEAN Set;

{	    /*	 this routine will draw a rule */

    if( a > 0 && b > 0 ) {
	SetPosn(h,v);                   /* lower left corner */
	EMITN(PixRound(b,hconv));       /* width */
	EMITN(PixRound(a,vconv));       /* height */
	EMITS("ru\n");
	}
    if (Set)
	h += b;
}


/*-->SetString*/
/**********************************************************************/
/*****************************  SetString  ****************************/
/**********************************************************************/

void
SetString(firstch, PassNo)              /* read and set a consecutive string of chars */
int firstch, PassNo;
{
    char s[256];
    register char *sp;
    register int  c;
    register struct char_entry *ptr;
    int len, hhold;

    /* read entire string of chars */

    for(c = firstch, sp = s;  c >= SETC_000 && c <= SETC_127; ) {
	*sp++ = c;
	c = NoSignExtend(dvifp, 1);
	}
    fseek(dvifp, -1, 1);        /* backup one character */

    len = sp - s;               /* NULL's are valid chars, so cant use for string termination */

    /* ensure that all characters are loaded, */

    for(sp = s; sp < s+len; sp++) {
	ptr = &(fontptr->ch[*sp]);
	if( !(ptr->where.isloaded) )
		LoadAChar(*sp, ptr);
	}

    /* emit the instructions */

    if( PassNo == 0 ) return;
    SetPosn(h, v);
    if( fontptr->font_file_id != NO_FILE ) {     /* ignore missing fonts */
	if( len <= 1 ) {
	    EMITN(s[0]); 
	    EMITS("c\n"); 
	    }
	else {
	    EMITC('(');
	    for( sp=s;  sp < s+len;  sp++) {
		    if( *sp < ' ' || *sp >= 0177 )
			    EMITO(*sp);
		    else if( *sp == '(' || *sp == ')' || *sp == '\\') {
			    EMITC('\\'); 
			    EMITC(*sp); 
			    }
		    else
			    EMITC(*sp);
		    }
	    EMITS(") s\n");
	    }
	}

    /* compute updated positions */
    
    hhold = hh;
    for(sp = s; sp < s+len; sp++) {
	ptr = &(fontptr->ch[*sp]);
	h += ptr->tfmw;
	hh += ptr->tfmw;
	}
    if( fontptr->font_file_id == NO_FILE ) hh = hhold;   /* because it didn't move */

#ifdef STATS
    Stnc += len;
    fontptr->ncts += len;
#endif
}


/*-->SignExtend*/
/**********************************************************************/
/****************************  SignExtend  ****************************/
/**********************************************************************/

int
SignExtend(fp, n)   /* return n byte quantity from file fd */
register FILE *fp;  /* file pointer    */
register int n;     /* number of bytes */

{
    int n1;         /* number of bytes	    */
    register int x; /* number being constructed */

    x = getc(fp);   /* get first (high-order) byte */
    n1 = n--;
    while (n--)  {
	x <<= 8;
	x |= getc(fp);
    }

    /* NOTE: This code assumes that the right-shift is an arithmetic, rather
    than logical, shift which will propagate the sign bit right.   According
    to Kernighan and Ritchie, this is compiler dependent! */

    x<<=32-8*n1;
    x>>=32-8*n1;  /* sign extend */

#ifdef DEBUG
    if (Debug)
    {
	fprintf(stderr,"\tSignExtend(fp,%d)=%X\n",n1,x);
    }
#endif
    return(x);
}


/*-->SkipFontDef*/
/**********************************************************************/
/****************************  SkipFontDef  ***************************/
/**********************************************************************/

void
SkipFontDef(k)
int k;
{
    int a, l;
    char n[STRSIZE];

    NoSignExtend(dvifp, 4);
    NoSignExtend(dvifp, 4);
    NoSignExtend(dvifp, 4);
    a = NoSignExtend(dvifp, 1);
    l = NoSignExtend(dvifp, 1);
    GetBytes(dvifp, n, a+l);
}


/*-->Warning*/
/**********************************************************************/
/*****************************  Warning  ******************************/
/**********************************************************************/

void
Warning(fmt, a, b, c)  /* issue a warning */
char *fmt;	/* format   */
char *a, *b, *c;	/* arguments */
{
    if (G_logging == 0)
    {
	if (G_logfile)
		G_logfp=fopen(G_Logname,"w+");
	else {
		G_logfp=stderr;
		if( G_nowarn ) return;
		}
	G_logging = 1;
	if (G_logfp == NULL) G_logging = -1;
    }

    G_errenc = TRUE;
    if (G_logging == 1)
    {
	fprintf(G_logfp, fmt, a, b, c);
	fprintf(G_logfp,"\n");
    }
}


SHAR_EOF
fi # end of overwriting check
#	End of shell archive
exit 0

lamy@ai.toronto.edu (12/01/86)

part 3 of 3

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	findfile.c
#	LaserPrep.uu
# This archive created: Sun Nov 30 19:06:12 1986
export PATH; PATH=/bin:$PATH
if test -f 'findfile.c'
then
	echo shar: will not over-write existing file "'findfile.c'"
else
cat << \SHAR_EOF > 'findfile.c'
/* findfile.c
 * Copyright 1985 Massachusetts Institute of Technology
 */

#include <stdio.h>
#include <sys/types.h>
#include <sys/dir.h>
#include "findfile.h"

int
findfileindir(area, name, mag, s, nname, nmag)
     char *area,*name,*s,*nname;
     int mag,*nmag;
{
  FILE *f;
  char buf[BUFSIZ];
  int found = 0;
    
  sprintf(s,"%s/SUBDIR",area);
  if (!access(s,0)) sprintf(s,"%s/%s/%s.%dpxl",area,name,name,mag);
  else sprintf(s,"%s/%s.%dpxl",area,name,mag);
  if (!access(s,4)) {
    strcpy(nname,name);
    *nmag = mag;
    return(-1);
  } else {
    sprintf(buf,"%s/NEEDED",area);
    if (!access(buf,2)) {
      sprintf(s,"%s.%dpxl\n",name,mag);
      f = fopen(buf,"r+");
      while (fgets(buf,sizeof(buf),f)) if (!strcmp(buf,s)) found++;
      if (!found) fputs(s,f);
      fclose(f);
    }
    return(0);
  }
}


/* true if it found a file, false otherwise; name is in s */
int findfile(dirvec,dirveclen,area, name, mag, s, nname, nmag)
     char *dirvec[],*area,*name,*s,*nname;
     int dirveclen,mag,*nmag;
{
  int i,point;
  char family[128];

  strcpy(nname,name);
  *nmag = mag;
  point = -1;
  (void) sscanf(name,"%[^0123456789.]%d",family,&point);

  /* First check dir area given in DVI file */
  if (*area && findfileindir(area, name, mag, s, nname, nmag)) return(-1);
  
  /* Then check along dirvec */
  for (i = 0; i < dirveclen; i++) 
    if (findfileindir(dirvec[i], name, mag, s, nname, nmag)) return(-1);

  /* next check for closest magnification along dirvec */
  return(findanyfile(dirvec,dirveclen,family,point,mag,name,s,nname,nmag));
}
  
int strdiff(s1,s2)
     char *s1,*s2;
{
  register int diff = 0;

  while (*s1 && *s2) diff += abs(*s1++ - *s2++);
  while (*s1) diff += *s1++;
  while (*s2) diff += *s2++;
  return(diff);
}

scanpdir(dir,name,
	 family,point,mag,
	 bestfamily,bestname,bestpoint,bestmag,
	 min_df,min_dp,min_dm)
     char *dir,*name,*family,*bestfamily,*bestname;
     int point,mag,*bestpoint,*bestmag,*min_df,*min_dp,*min_dm;
{
  DIR *dirstream;
  struct direct *dirrecord;
  char qfamily[128];
  int qpoint,qmag,df,dp,dm;

  if (dirstream = opendir(dir)) {
    while (dirrecord = readdir(dirstream)) {
      if (!strcmp(dirrecord->d_name+dirrecord->d_namlen-3,"pxl")) {
	qpoint = -1; qmag = -1;
	(void) sscanf(dirrecord->d_name,"%[^0123456789.]%d.%d",
		      qfamily,&qpoint,&qmag);
	df = strdiff(family,qfamily);
	dp = abs(point - qpoint);
	dm = abs(mag - qmag);
	if ((df < *min_df)
	    || (df == *min_df && dp < *min_dp)
	      || (df == *min_df && dp == *min_dp && dm < *min_dm)) {
		sprintf(bestname,"%s/%s",dir,dirrecord->d_name);
		strcpy(bestfamily,qfamily);
		*bestpoint = qpoint;
		*bestmag = qmag;
		*min_df = df;
		*min_dp = dp;
		*min_dm = dm;
	  }
      }
    }
    closedir(dirstream);
  }
}

scandir(dir,name,
	family,point,mag,
	bestfamily,bestname,bestpoint,bestmag,
	min_df,min_dp,min_dm)
     char *dir,*name,*family,*bestfamily,*bestname;
     int point,mag,*bestpoint,*bestmag,*min_df,*min_dp,*min_dm;
{
  DIR *dirstream;
  struct direct *dirrecord;
  int df;
  char pdir[MAXNAMLEN];

  if (dirstream = opendir(dir)) {
    while (dirrecord = readdir(dirstream)) {
      if (dirrecord->d_name[0] != '.') {
	df = strdiff(name,dirrecord->d_name);
	if (df <= *min_df) {
	  sprintf(pdir,"%s/%s",dir,dirrecord->d_name);
	  scanpdir(pdir,name,
		   family,point,mag,
		   bestfamily,bestname,bestpoint,bestmag,
		   min_df,min_dp,min_dm);
	}
      }
    }
    closedir(dirstream);
  }
}


/* finds the best match to the desired font */
int findanyfile(dirvec,dirveclen,family,point,mag,name,s,nname,nmag)
     char *dirvec[],*family,*name,*s,*nname;
     int dirveclen,point,mag,*nmag;
{
  char foo[MAXNAMLEN],bestname[MAXNAMLEN],bestfamily[128];
  int min_df,min_dp,min_dm,df,dp,dm,i,bestpoint,bestmag;
  
  bestname[0] = '\0'; 
  min_df = min_dp = min_dm = 9999999;
  for (i = 0; i < dirveclen; i++) {
    sprintf(foo,"%s/SUBDIR",dirvec[i]);
    if (!access(foo,0)) scandir(dirvec[i],name,
				family,point,mag,
				bestfamily,bestname,&bestpoint,&bestmag,
				&min_df,&min_dp,&min_dm);
    else scanpdir(dirvec[i],name,
		  family,point,mag,
		  bestfamily,bestname,&bestpoint,&bestmag,
		  &min_df,&min_dp,&min_dm);
  }
  if (bestname[0]) {
    if (bestpoint > 0) sprintf(nname,"%s%d",bestfamily,bestpoint);
    else strcpy(nname,bestfamily);
    *nmag = bestmag;
    strcpy(s,bestname);
    if ((strcmp(bestfamily,family)
	 || bestpoint != point || abs(bestmag - mag) > 2)) 
      fprintf(stderr,
	      "Substituted font %s at mag %d for %s at mag %d.\n",
	      nname,(bestmag * 4 + 3) / 6,
	      name,(mag * 4 + 3) / 6);
    return(-1);
  }
  return(0);
}
  
SHAR_EOF
fi # end of overwriting check
if test -f 'LaserPrep.uu'
then
	echo shar: will not over-write existing file "'LaserPrep.uu'"
else
cat << \SHAR_EOF > 'LaserPrep.uu'
begin 644 LaserPrep.ps
M)2$*)3 P,# P,# P,# *)2!#;W!Y4FEG:'0@07!P;&4@0V]M<'5T97(L($EN
M8RX@,3DX-"P@,3DX-2 @($%L;"!2:6=H=',@4F5S97)V960N"B4*)2 D2&5A
M9&5R.B!,87-E<E!R97 N<',L=B T,"XT(#@V+S$Q+S(W(#$T.C0T.C(X(&QA
M;7D@17AP("0*)0HE("1,;V<Z"4QA<V5R4')E<"YP<RQV("0*)2!2979I<VEO
M;B T,"XT(" X-B\Q,2\R-R @,30Z-#0Z,C@@(&QA;7D*)2!A;&P@9F]N="!R
M92UE;F-O9&EN9R]R96YA;6EN9R!N;W<@9&]N92!A="!T:&4@96YD+@HE( HE
M(%)E=FES:6]N(#0P+C,@(#@V+S$Q+S W(" Q,#HR,3HU-B @;&%M>0HE(%)E
M;6]V960@8VAA<F%C=&5R<R!W:71H(&AI9V@M;W)D97(@8FET('-E="!T:&%T
M(&-A=7-E9"!#4TYE="!M86EL"B4@97AC:&%N9V5S('1O(&9R965Z92X@($1E
M9FEN:71I;VX@;V8@7'AS(&AA9"!-+4H@32U*('-E<G9E<F1I8W0@:6YS=&5A
M9 HE(&]F(# @<V5R=F5R9&EC="P@<V\@=&AI<R!K:6QL<R!T=V\@8FER9',@
M=VET:"!O;F4@<W1O;F4N"B4@"B4@4F5V:7-I;VX@-# N,B @.#8O,3 O,S @
M(#$Y.C4R.C4P("!L86UY"B4@06QL(&9O;G1S('1H870@:&%V92!A('-T86YD
M87)D(&5N8V]D:6YG(&%R92!R96UA<'!E9"!T;R!!<'!L90HE(&-O;G9E;G1I
M;VYS(&%N9"!G:79E;B!A(%Q?7U]?7U\@;F%M92X@(%1H:7,@:7,@;F]W(&1O
M;F4@:6X*)2!A(&QO;W @:6YS=&5A9"!O9B!B>2!E;G5M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E,@+U53
M"FUA8W9E8R P(#,R(&=E=&EN=&5R=F%L(&%S=&]R92!P;W *;6%C=F5C(#,R
M("]4:6UE<RU2;VUA;B!F:6YD9F]N=" O16YC;V1I;F<@9V5T"C,R(#DV(&=E
M=&EN=&5R=F%L('!U=&EN=&5R=F%L(&UA8W9E8R!D=7 @,SD@+W%U;W1E<VEN
M9VQE('!U=" Y-B O9W)A=F4@<'5T"B]!9&EE<F5S:7,@+T%R:6YG("]#8V5D
M:6QL82 O16%C=71E("].=&EL9&4@+T]D:65R97-I<R O561I97)E<VES("]A
M86-U=&4*+V%G<F%V92 O86-I<F-U;69L97@@+V%D:65R97-I<R O871I;&1E
M("]A<FEN9R O8V-E9&EL;&$@+V5A8W5T92 O96=R879E"B]E8VER8W5M9FQE
M>" O961I97)E<VES("]I86-U=&4@+VEG<F%V92 O:6-I<F-U;69L97@@+VED
M:65R97-I<R O;G1I;&1E("]O86-U=&4*+V]G<F%V92 O;V-I<F-U;69L97@@
M+V]D:65R97-I<R O;W1I;&1E("]U86-U=&4@+W5G<F%V92 O=6-I<F-U;69L
M97@@+W5D:65R97-I<PHO9&%G9V5R("]D96=R964@+V-E;G0@+W-T97)L:6YG
M("]S96-T:6]N("]B=6QL970@+W!A<F%G<F%P:" O9V5R;6%N9&)L<PHO<F5G
M:7-T97)E9" O8V]P>7)I9VAT("]T<F%D96UA<FL@+V%C=71E("]D:65R97-I
M<R O;F]T97%U86P@+T%%("]/<VQA<V@*+VEN9FEN:71Y("]P;'5S;6EN=7,@
M+VQE<W-E<75A;" O9W)E871E<F5Q=6%L("]Y96X@+VUU("]P87)T:6%L9&EF
M9B O<W5M;6%T:6]N"B]P<F]D=6-T("]P:2 O:6YT96=R86P@+V]R9&9E;6EN
M:6YE("]O<F1M87-C=6QI;F4@+T]M96=A("]A92 O;W-L87-H"B]Q=65S=&EO
M;F1O=VX@+V5X8VQA;61O=VX@+VQO9VEC86QN;W0@+W)A9&EC86P@+V9L;W)I
M;B O87!P<F]X97%U86P@+T1E;'1A("]G=6EL;&5M;W1L969T"B]G=6EL;&5M
M;W1R:6=H=" O96QL:7!S:7,@+V)L86YK("]!9W)A=F4@+T%T:6QD92 O3W1I
M;&1E("]/12 O;V4*+V5N9&%S:" O96UD87-H("]Q=6]T961B;&QE9G0@+W%U
M;W1E9&)L<FEG:'0@+W%U;W1E;&5F=" O<75O=&5R:6=H=" O9&EV:61E("]L
M;WIE;F=E"B]Y9&EE<F5S:7,@+UED:65R97-I<R O9G)A8W1I;VX@+V-U<G)E
M;F-Y("]G=6EL<VEN9VQL969T("]G=6EL<VEN9VQR:6=H=" O9FD@+V9L"B]D
M86=G97)D8FP@+W!E<FEO9&-E;G1E<F5D("]Q=6]T97-I;F=L8F%S92 O<75O
M=&5D8FQB87-E("]P97)T:&]U<V%N9" O06-I<F-U;69L97@@+T5C:7)C=6UF
M;&5X("]!86-U=&4*+T5D:65R97-I<R O16=R879E("])86-U=&4@+TEC:7)C
M=6UF;&5X("])9&EE<F5S:7,@+TEG<F%V92 O3V%C=71E("]/8VER8W5M9FQE
M> HO87!P;&4@+T]G<F%V92 O56%C=71E("]58VER8W5M9FQE>" O56=R879E
M("]D;W1L97-S:2 O8VER8W5M9FQE>" O=&EL9&4*+VUA8W)O;B O8G)E=F4@
M+V1O=&%C8V5N=" O<FEN9R O8V5D:6QL82 O:'5N9V%R=6UL875T("]O9V]N
M96L@+V-A<F]N"FUA8W9E8R Q,C@@,3(X(&=E=&EN=&5R=F%L(&%S=&]R92!P
M;W *+WQ?7U]?7U]396%T=&QE("](96QV971I8V$@9FEN9&9O;G0@9'5P(&QE
M;F=T:" Q(&%D9"!D:6-T("]T;7 @>&1F(&-F(&UV"B]M>'9;+WIE<F\@+V]N
M92 O='=O("]T:')E92 O9F]U<B O9FEV92 O<VEX("]S979E;B O96EG:'0@
M+VYI;F4@+V-O;6UA("]P97)I;V0@+V1O;&QA<B O;G5M8F5R<VEG;@HO<&5R
M8V5N=" O<&QU<R O:'EP:&5N("]%("]P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]N=$YA;64@/&)O;VQE86X^"B @("!](&EF96QS90H@('T@
=:69E;'-E"GT@8FEN9"!F;W)A;&P*96YD("5M9 H@
 
end
SHAR_EOF
echo "attempting to extract LaserPrep.ps by uudecoding LaserPrep.uu"
uudecode LaserPrep.uu
fi # end of overwriting check
#	End of shell archive
exit 0