

        
                                                          <Page No.   1>
        ----------------------------------------------------------------
        
         ______________________________________________________________ 
        ||                                                            ||
        ||                       SAM76 LANGUAGE                       ||
        ||                                                            ||
        ||          General Description of the Hershey Fonts          ||
        ||                    Details of the files                    ||
        ||                                                            ||
        ||                                                            ||
        ||                                                            ||
        ||        Karl Nicholas, John Dale and Ancelme Roichel        ||
        ||                                                            ||
        ||                     Technical Note 10                      ||
        ||                                                            ||
        ||             Summer 1981 - Revised Summer 1986              ||
        ||                                                            ||
        ||                                                            ||
         ______________________________________________________________ 
        
        
        
        
        

        
        SAM76 Technical Note 10 - Hershey Fonts - 1986..<Page No.   H-2>
        ----------------------------------------------------------------
        
         ______________________________________________________________ 
        ||                                                            ||
        ||                     Notes and Notices                      ||
        ||                                                            ||
         ______________________________________________________________ 
        
        
        
        
        
        The  material contained in this technical note may be reproduced
        freely  for  non-commercial use providing that credit is clearly
        given  in such usage to SAM76 Inc., as well as to A. V. Hershey.
        Permission  for  commercial  use will be granted upon request. A
        courtesy  copy  of  any  material  which  uses any of the matter
        contained  in  this technical note should be sent to SAM76 Inc.,
        Box 257, RR1 Pennington, N.J., USA.
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
         ______________________________________________________________ 
        ||                                                            ||
        ||       Copyright 1984, SAM76 Inc., Pennington, N. J.        ||
        ||                                                            ||
         ______________________________________________________________ 
        

        
         Revision                                       <Page No.   H-3>
        ----------------------------------------------------------------
        
         ______________________________________________________________ 
        ||                                                            ||
        ||           SAM76 Technical Note 10 - Revised 1986           ||
        ||                                                            ||
         ______________________________________________________________ 
        
        
        
        1.      Background
        
        An  extensive  repertory  of digitized graphical character fonts
        was  developed by Dr. A. V. Hershey (retired) of the U. S. Naval
        Weapons  Laboratory  during  the  1950 to 1967 period. This data
        base  was  made  available  to  the  general  public through the
        National   Bureau   of   Standards  in  its  original  form  for
        manipulation   on  large  computer  systems  equipped  with  X-Y
        plotters.
        
        
        This  public  domain, and paid for by the taxpayer, data base is
        currently  in  wide  use  in  many software packages, frequently
        without  crediting  the  original author for his work. It may be
        found  in  FANCY  FONTS, SIGNMASTER, the Apple McIntosh, Hewlett
        Packard  systems,  Tektronix Systems, AT & T Image capture board
        systems to name but a few.
        
        
        The  original format was very unwieldy for use in micro computer
        systems, particularly because of the extremely large size of the
        data  base.  This  large  data  base was reorganized and greatly
        compressed  to  render its use practical in early memory limited
        microcomputer  systems.  The  data  base  is available on floppy
        diskettes  arranged  to run either under CP/M or MS/DOS systems.
        Manipulation of these data bases by using the SAM76 language, or
        if in ASCII format then by using FORTRAN, BASIC &c.
        
        
        Each  font file on the diskettes made available by SAM76 contain
        a  number  of  iindividual  records,  each  record  provides the
        description  of a graphical symbol - alpha numeric or pictorial.
        This  description  is  in  terms  of pairs of signed incremental
        integer vectors:
        
        
        deltaX1,deltaY1,deltaX2,deltaY2,.....deltaXn,deltaYn
        
        
        Additional  control  information  may  appear  in  these records
        prefixing the deltaX term. Typical of these are:
        
        
         ...,UdeltaX,deltaY,...         "PEN UP" (invisible vector)
         ...,WdeltaX,deltaY,...         Width left and right of center
        
        
        Compression  of  the  records  was  also achieved by eliminating
        vectors of zero length thus:
        
         ...deltaX,,deltaX1,deltaY1
        
        in  the  above prototype string there is a deltaY vector of zero
        length between the two adjacent commas.
        
        

        
        SAM76 Technical Note 10 - Revised 1986          <Page No.   H-4>
        ----------------------------------------------------------------
        
        
        Maintenance  of  the character descriptions in this mode renders
        the task of scaling and quadrant rotation very simple when it is
        desired  to  plot  them.  The  name  of  each record in an alpha
        numeric font is given the "HEX" equivalent of its USASCII or ISO
        code for the character being described.
        
        
        The  plot  function in the SAM76 language is "WS" and is defined
        to  generate  a  plot  of  the argument string that follows this
        command in a given expression thus:
        
          %ws,dx,dy,dx1,dy1,.....,dxN,dyN/=
        
        
        furthermore  the  SAM76  language permits nesting of expressions
        and so one may plot a record named "41" by:
        
          %ws,%41//=
        
        Recognizing that "41" is the hexadecimal equivalent of the upper
        case  "A" in the latin alphabet, one can then plot the character
        "A" using a nested "CX" - Character to X (HEX) conversion thus:
        
         %ws,%%cx,,A///=
        
        
        The reason for the double comma in the above expression is based
        on  the  actual  definition of the "CX" function (to be found in
        the SAM76 language manual).
        
        
        The  plot  of  a  character  which  it  is  desired  to  receive
        interactively from a keyboard is further achieved by the nesting
        of the "IC" - Input Character command thus:
        
          %ws,%%cx,,&ic////=
        
        
        If  it  is  desired  to  create a continuously looping procedure
        which  would  accept  input  from the keyboard, plot it and then
        repeat the process one would define such a procedure thus:
        
          %dt,draw,!%ws,%%cx,,&ic////%draw///=
        
        
        The process is then started by merely entering:
        
          %draw/=
        
        
        Scale  changes  are  accomplished  through  the  use of the "WS"
        function when an upper case "S" prefixes a pair of vectors which
        represent the desired new "INTEGER" scale multiplier desired for
        the deltaX and deltaY terms respectively thus:
        
          %ws,S2,3,dx1,dy1,dx2,dy2,..../=
        
        will  cause  the dx1, ... dxN to be multiplied by 2 and the dy1,
        ... dyN to be multiplied by 3.
        
        

        
        SAM76 Technical Note 10 - Revised 1986          <Page No.   H-5>
        ----------------------------------------------------------------
        
        
        Quadrant  rotation  is achieved through the use of the "PL,MQ,d"
        function  where  "d" is a number between 0 and 7, selecting thus
        one  out of eight quadrandts. (These are the four normal and the
        four mirror image quadrants).
        
          %pl,mq,1/=
        
        will cause all subsequent uses of the "WS" function to plot in a
        quadrant  rotated  90 degrees from the normal. Normal means that
        the  X=0  and Y=0 points are at the bottom left of the medium, X
        and Y increasing in a positive sense to the right and up.
        
         ______________________________________________________________ 
        ||                                                            ||
        ||                    DOT MATRIX plotting                     ||
        ||                                                            ||
         ______________________________________________________________ 
        
        
        
        The  foregoing  description  of  the plotting function using the
        SAM76  language  would  appear  to  be  limited to typical X - Y
        plotting  equipment,  and  in  fact  superior  resolution can be
        achieved  with such a configuration using plotter capable of 200
        increments per inch or better.
        
        
        Dot  matrix  plotting is based on the visualization of a digital
        medium  which  has  a  horizontal and vertical resolution of one
        bit. This bit may be a "pixel" or may be a "blob" as in the case
        of of early graphics screens (eg: TRS80 model 1). The SAM76 plot
        function  drivers  are arranged so that a "pixel" or a "blob" is
        turned on when traversed by a drawn line.
        
        
        Software  drivers  that  interface the SAM76 plot function and a
        variety  of  different graphic screen and plotters are available
        and their use is transparent to the user.
        
        
        Once the plot is generated on a display screen it is possible to
        cause  a  printout  of  the  screen  with  additional  software.
        Printing  quality  is then only a function of the dot resolution
        capability  of  the printing machine being used. For instance an
        EPSON  MX80,  FX80  &c. is capable of printing 120 dots per inch
        horizontally  and 216 dots per inch vertically. An approximately
        square  image may be printed by plotting with a horizontal scale
        multiplier of 1 and a vertical scale multiplier of 2.
        
        
        In order to print all the way across an eight inch wide paper it
        is  necessary  to plot on a screen which has a width of 960 dots
        or  pixels.  The height of the HERSHEY fonts vary from a mimimum
        of approximately 10 dots to a maximum of about 60 dots.
        
        
        Average  character  height  is about 24 dots, the oriental fonts
        have  a height of 28 dots maximum. From the foregoing it is then
        necessary  to have a display screen with a horizontal resolution
        of  960 dots, and a vertical resolution of 64 dots to accomodate
        one  line  of  graphics  to  be  output  on  EPSON  high quality
        printers.

        
        SAM76 Technical Note 10 - Revised 1986          <Page No.   H-6>
        ----------------------------------------------------------------
        
        
        
        This  is  feasible  on  most graphic screens by fooling the plot
        program  into believing that its plot surface is 960 by 64, that
        is  to  say  by automatically carrying off the end of the actual
        screen to a point 64 raster lines lower when the right hand edge
        of  the  screen is reached. This is the method used on the APPLE
        ][, and the PC color graphics card.
        
         ______________________________________________________________ 
        ||                                                            ||
        ||        Further enhancements for dot matrix printing        ||
        ||                                                            ||
         ______________________________________________________________ 
        
        
        
        In  the  foregoing  description  printing of plotted graphics is
        based  on  the actual plotting of each character each time it is
        used  from  the  data base. This can be quite slow. Considerable
        speed improvement may be achieved by generating the full font in
        its  dot matrix format once - for each scale in X and Y desired.
        Then  the  individual dot matrix patterns for each character may
        be  transferred  wherever  desired on the screen and then when a
        line is composed may then be printed.
        
        
        Other  speed  improvements  may  be  achieved  by converting the
        incremental  data base from its USASCII string representation to
        a  binary form. In general each vector can be described with two
        8 bit words including sign and "pen up" information.
        
        
        It  is  felt that it is better to maintain the data base in some
        incremental  form  rather  than  in  a  pre-plotted  dot  matrix
        arrangement.  The  ability  to  mathematically  manipulate these
        incremental  tables producing a variety of sizes and shapes from
        single   font  tables  is  most  desirable.  Rapid  advances  in
        microcomputer speeds and equally rapid reductions in their costs
        suggests  that acceptable plot and print on demand speeds may be
        achieved in the very near future. (written in 1981).
        
        

        
                                                        <Page No.   H-7>
        ----------------------------------------------------------------
        
         ______________________________________________________________ 
        ||                                                            ||
        ||             NOTE REGARDING THE "HERSHEY" FONTS             ||
        ||                                                            ||
         ______________________________________________________________ 
        
        
        
        These  incremental vector list were derived from an original set
        of  absolute  vector  tables  designed  and created by Dr. A. V.
        Hershey  -  U.S. NAVY WEAPONS LAB, Dahlgren, VA. (Dr. Hershey is
        retired).
        
        
        Any   publication   or  other  use  of  these  fonts  should  be
        accompanied  by  a  courtesy citation to recognize Dr. Hershey's
        contribution  -  furthermore the value of these fonts should not
        be  included  in  the  pricing of applications which make use of
        them.
        
               NOTES REGARDING the HERSHEY fonts in SAM76 format        
        
        Each  file contains one font an link information if a common use
        secondary file is required.
        
        Following records may be in the font files:
        
        FONT    name of font itself
        NUMB    name of file required to complete font
        MORE    procedure which will bring additional font in memory
        
        xx      hex numbers from 20 to 7F which is the USASCII value
        
        xyz*    additional graphic symbols
        
        aip32   means Amer. Inst. of Physics symbol 32
        cir17   means circle diameter of 17
        
               NOTES REGARDING the HERSHEY fonts in ASCII format        
        
        For users of software other than the SAM76 language, the HERSHEY
        fonts are available (as a public service) in USASCII format. The
        technical  content  is identical to the SAM76 format except that
        there is no need for the records NUMB, FONT, and MORE identified
        above.  The files have the same name, are typeable, and the user
        should type a file to see how the records are organized.
        
        

        
        The Hershey Font Files                          <Page No.   H-8>
        ----------------------------------------------------------------
        
        
        Font name is code which is descriptive of font:
        
        First - Letter -
                K       Cartographic
                S       Simplex - single stroke
                D       Duplex - double stroke
                P       Polyplex - multiple stroke
                C       Complex - complex strokes
        
        Second  Symbol -
                0       Smallest size
                1       Intermediate size
                2       Largest size
        
        Third - Letter
                U       Upright
                I       Italic
                S       Script
                G       Gothic
        
        Fourth  Letter
                R       Roman
                C       Cyrillic
                G       Greek
                E       English
                D       Deutsch
                I       Italian
                A       Arithmetic
                S       Symbols
                X       Miscellaneous
                M       Musical
        
        
        Each  font  symbol  is  described  as  a sequence of incremental
        vector  pairs  - DELTA X,DELTA Y. The DELTA X vector of any pair
        may  be  headed  by one or more upper case alphabetic symbols as
        follows:
        
                U       "pen up" for this pair
                W       width to left width to right of center
                                used only for text justification
                S       Scale change
                A       Absolute vectors follow
                I       Incremental vectors follow
        
        
        With  exception  of  the  graphics  in  the  file HSUB.PIX, each
        character when drawn starts at the current "pen" location and on
        completion  leaves  the "pen" ready for the next character - the
        overall  character  width (including guard spaces) is the sum of
        the WdeltaX,deltaY vector pair.
        
        
        The  fonts  on  the  oriental  disk  comprise  the full group of
        oriental  characters  digitized  by  A.  V. Hershey while at the
        Naval Weapons Research Lab.
        
        

        
        The Hershey Font Files                          <Page No.   H-9>
        ----------------------------------------------------------------
        
        
        Details  of  their  design and application are given in a report
        available from the NWL entitled:
        
        Calligraphy  for  Computers - Tech Report No. 2101, dated August
        1, 1967.
        
        
        The vectors on the SAM76 disks were derived from those furnished
        by  the National Bureau of Standards on a standard IBM704 tape -
        the  format  being intended for use by FORTRAN programmers is in
        absolute vector form.
        
        
        SAM76  graphics functions can plot vector pairs specified either
        as "absolute" o "incremental".
        
        Since  arithmetic  manipulation  is  more  readily  performed on
        incremental  vectors,  and  since considerable space is saved by
        having the vectors in that form, the original set was converted.
        
        
        Font  files are normally accessed by the SAM76 "BF" - Bring File
        function,  and  each file contains a number of SAM76 texts whose
        names identify the individual vector lists.
        
        
        This identification is of one of the following types:
        
        A.      HEX  number  is value of the USASCII character generated
        by a particular vector list.
        
        B.      Descriptive  name  or American Institute of Physics code
        number for these characters.
        
        All  of  these digitizations are in the public domain, but it is
        most  strongly  sugested  that  if  they  are  used in any works
        intended   for   publication  an  appropriate  entry  or  notice
        crediting   Dr.  A.  V.  Hershey  be  suitably  and  prominently
        included.
        
         ______________________________________________________________ 
        ||                                                            ||
        ||                         REFERENCES                         ||
        ||                                                            ||
         ______________________________________________________________ 
        
        
        
        1.      Hershey,  A.  V.  "Calligraphy for Computers", Technical
        report  No.  2101,  U.  S.  Naval  Weapons Laboratory, Dahlgren,
        Virginia; (1 August 1967).
        
        2.      Wolcott,  Norman  N., and Hilsenrath, Joseph, "Tables of
        Coordinates for Hershey's Repertory of Occidental Type Fonts and
        Graphic  Symbols",  NBS Special Publication 424, U.S. Department
        of Commerce / National  Bureau of Standards; (April 1976).
        
        3.      Nelson,  Andrew  Nathaniel,  "Japanese English Character
        Dictionary",  Charles  E.  Tuttle  Company;  Publishers, Rutland
        Vermont and Tokyo Japan.
        

        
        The Hershey Font Files                          <Page No.  H-10>
        ----------------------------------------------------------------
        
        
               <Page No.  H-10>
        ------------------------