RDict




RDict is a stripped-down version of PrePress, produced by  Lyle Ramshaw
(PARC, CSL) in late 1979 for the special purpose of rotating all of the
fonts in a large dictionary.  Suppose that you are the proud owner of a
dictionary of  orbitized rasters,  say the  Spruce.Fonts of  your local
Dover printer.  You would like to produce a new dictionary of orbitized
rasters, in which each font has been rotated through 90 degrees.  To do
this job with PrePress, you would have to Extract,  DeOrbitize, Rotate,
Orbitize,  and  then  Merge each  font  individually.   With  the RDict
program,  you can  eliminate  the Extract  and Merge  portions  of this
scenario, and save  yourself the production of  a large sea  of command
lines as well.

The input to  RDict is a  dictionary of rasters,  all of which  must be
either of type OrbitChars or type MultiChars.  RDict will  simply throw
away the extra width  information included in the  MultiChars segments,
and produce an  output dictionary in which  all of the segments  are of
type OrbitChars.

RDict is controlled via the command line.  Invoke RDict by saying
            RDict <InputFileName> <Angle> <OutputFileName>

where  the  three  parameters  are as  follows.   If  you  have trouble
remembering the order of the three arguments, you may invoke RDict with
the  command line  "RDict", and  it  will prompt  you for  each  of the
arguments in turn.

The <InputFileName> is  a regular file  name, optionally preceded  by a
disk specifier.  To  refer to a file  on the standard system  disk, you
may use  the disk  specifier "dp0:",  or just  omit the  disk specifier
entirely.  Upper and lower  case are equivalent in disk  specifiers, so
"DP0:" or  "Dp0:" or  "dP0:" mean  the same  as "dp0:".   The specifier
"dp1:" refers to the other  Diablo Model 31 drive, should your  Alto be
so equipped.   Trident T-80  drives are referred  to as  "tp0:" through
"tp7:".  Trident  T-300 drives  contain up  to three  entirely distinct
Alto file systems; the three file systems on physical T-300 drive 3 are
referred  to as  "tp3:", "tp403:",  and "tp1003:"  (for  arcane reasons
that, if you have a T-300, you probably already know).

The <OutputFileName>  is a  regular file name  preceded by  an optional
disk specifier  in an  analogous fashion.  If  the output  file already
exists, RDict will overwrite it.

The <Angle> field specifies  the amount of additional rotation  that is
desired, as  a signed,  decimal quantity  expressed in  degrees (rather
than  minutes).  The  <Angle>  must be  a  multiple of  90  degrees, of
course.   The  rotation  specified  by  <Angle>  is   incremental,  not
absolute.  For example, suppose that  you use RDict to rotate  an input
dictionary  by 90  degrees; a  font in  the input  whose Rotation  is x
minutes  of arc  will be  written into  the output  with a  Rotation of
(x+5400) minutes, since 5400 minutes is 90 degrees.



                             ------------
                   Copyright Xerox Corporation 1979


RDict                      January 10, 1980                           2




RDict first scans the input file, and prints out for you how many fonts
of what types it contains, pausing  for 5 seconds to let you  read this
display.  Next, RDict writes a blank output file of roughly the correct
total length.  This guarantees that the disk containing the output file
will overflow right away if it will overflow at all, instead of waiting
until the program has run for several hours.  Having written this blank
output file, RDict next writes  at the beginning of that output  file a
PrePress-style index that describes  the desired output fonts;  one bit
in each  index entry,  however, specifies  that the  corresponding font
data has not  yet been rotated.  Then,  RDict takes each font  in turn,
and, for each character in that font, calls the standard  PrePress code
to DeOrbitize, Rotate, and then Orbitize that character.   [RDict could
be made to run more rapidly if a special Rotate were written  that went
from OrbitChars to OrbitChars directly; but I'm lazy, and I didn't want
to introduce any new bugs in the rasters themselves.] When  the rotated
font  data  has  been  completely  entered  in  the  output  file,  the
corresponding index entry is changed to mark that font as processed.

Since RDict runs tend to take a long time, there is a  high probability
that you might want to interrupt one someday. Once the output  file has
been  set  up,  and  actual rotations  of  fonts  have  begun,  you may
interrupt RDict at any time by merely typing <shift>-<swat>.  To resume
the computation at  some later time,  repeat the earlier  command line,
except type  "RDict/R" instead  of simply "RDict"  (the "R"  stands for
"Restart").  RDict will  scan the input and  output files to  check for
consistency, and then resume processing by starting to rotate the first
font that is not yet marked as complete.

Note that RDict can be used to throw away all but the most recent width
information  in the  MultiChars fonts  of a  dictionary,  without doing
anything  else.   To  convert  all  of  the  MultiChars  segments  in a
dictionary to the equivalent  OrbitChars segments, just run  RDict over
the dictionary  and specify "0"  as the <Angle>.   To make this  use of
RDict more convenient, the program makes a special check for an <Angle>
of 0, and, in this case, simply copies each character from the input to
the  output,  without  bothering to  DeOrbitize,  Rotate  by  zero, and
Orbitize again.

RDict is unforgiving about errors,  and solves most of its  problems by
calling Swat with some  flavor of message.  Errors generated  inside of
the code that Rotates, Orbitizes, and DeOrbitizes will also  call Swat.
For example, I hit  a "Character height inconsistancy" after  more than
four hours of rotating my Spruce.Fonts: life is hard.