home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d101 / psintrp.lha / PsIntrp / ps.doc < prev    next >
Text File  |  1987-09-05  |  7KB  |  196 lines

  1.  
  2. *
  3. *    This program is in the public domain.  PostScript is a trademark
  4. *   of Adobe Systems.
  5. *        Greg Lee, July, 1987.
  6. *   U.S. mail: 562 Moore Hall, Dept. of Linguistics
  7. *           University of Hawaii, Honolulu, HI 96822
  8. *     ARPA: uhccux!lee@nosc.ARPA
  9. *
  10. PS document
  11. Greg Lee, April, 1986
  12.  
  13. Ps emulates PostScript () Adobe Systems), in a small way.
  14.  
  15. Interactive input and output takes place in a small window.
  16. The page being composed is shown behind the window in an interlaced
  17. screen with 16 colors.  When input is
  18. redirected to come from a file with "ps < programfile", the ps program
  19. in this file is executed before interaction begins.
  20.  
  21. There is no prompt shown when ps is ready to receive console input.
  22.  
  23. Default screen coordinates are x = 0 to 639 from the left to the
  24. right of the screen, and y = 0 to 511 from the bottom to the top
  25. of the screen.  Considering the units to be points,
  26. that makes the display a nominal 8 8/9" across and 7 1/9" up and down.
  27.  
  28. Operators do more or less what they do in PostScript, except as
  29. noted below.  See PostScript Language: Reference Manual, Adobe
  30. Systems Incorporated, Addison-Wesley, 1985.
  31.  
  32. Ps has one built-in font named 'simplex', which is stroked.  (Data
  33. came from Alan Hershey's data base.)
  34.  
  35. Types implemented:
  36.  
  37.    integer, real, boolean, string, name, operator
  38.    array, mark, dictionary, save, fontID
  39.  
  40. Operators:
  41.  
  42.       *** stack manipulation ***
  43.    pop, exch, dup, copy
  44.    index, roll, clear, count
  45.    mark
  46.  
  47.             *** math ***
  48.    add, div, idiv, mod
  49.    mul, sub, abs, neg
  50.    ceiling, floor, round       [round gives floor of -ddddd.5]
  51.    truncate, sqrt
  52.    pow, tan, tanh, cosh, sinh  (non-standard)
  53.    atan, cos, sin
  54.    exp, ln, log
  55.  
  56.             *** array ***
  57.    array, [, ]
  58.    length, get, put
  59.  
  60.          *** dictionary ***
  61.    dict
  62.    length, maxlength
  63.    begin, end
  64.    def                  defined operators are simple objects, not arrays;
  65.                         "key" must be a name
  66.  
  67.            *** string ***
  68.    string               the '<..>' syntax is not implemented
  69.    length, get, put
  70.  
  71.       *** relational, Boolean ***
  72.    eq, ne, ge
  73.    gt, le, lt           comparisons for numbers only, not strings
  74.    true, false
  75.  
  76.          *** control ***
  77.    exec                 leaves anything but an operator on the stack
  78.    if, ifelse
  79.    for                  integers only
  80.    repeat, loop
  81.    exit
  82.    stop, stopped        untested
  83.    countexectack        always gives 0, since there is no exec stack
  84.    execstack            does nothing
  85.    quit                 exit to AmigaDos
  86.    start                does nothing
  87.  
  88.   *** type, attribute, conversion ***
  89.    cvi, cvr             no conversion from strings
  90.    cvs                  no range-check is done
  91.  
  92.            *** file ***
  93.    file, read, write    implemented only for %stdout and %stdin (which
  94.                         are always the console)
  95.    run                  can't nest run files or have 2 'run' commands
  96.                         on same line; use in defined procedures will not
  97.                         work properly, since 'run' merely redirects input
  98.    print, =
  99.  
  100.         *** virtual memory ***
  101.    save, restore        restore merely destroys objects created since
  102.                         the last save and reuses the memory space they
  103.                         occupied (in addition to doing a grestore)
  104.  
  105.         *** graphics state ***
  106.    gsave, grestore      colors are not saved or restored
  107.    setlinewidth         you get butt linecaps and bevel joins; the joins
  108.                         are not done properly for concave figures; when
  109.                         there is non-uniform scaling of the axes, rotation
  110.                         of the axes is not taken account of
  111.    currentlinewidth
  112.    setflat, currentflat
  113.    setgray              there are only 5 levels of grey available, set by
  114.                         argument: n = 0, 0 < n < .25, .25 <= n < .5, .5 <= n
  115.                         < .75, .75 <= n <= 1
  116.    currentgray
  117.    setrgbcolor          affects only current foreground pen color;
  118.                         takes 3 arguments in range 0-15
  119.    currentrgbcolor      components of current foreground pen color
  120.  
  121.        *** coordinate system ***
  122.    translate
  123.    scale                for Amiga fonts, does not affect sizes of letters;
  124.                         moves currentpoint (bug)
  125.    rotate               for Amiga fonts, does not affect orientation
  126.    concat, concatmatrix
  127.    transform, dtransform
  128.  
  129.        *** path construction ***
  130.    newpath, currentpoint
  131.    moveto, rmoveto
  132.    lineto, rlineto
  133.    curveto, rcurveto
  134.    closepath
  135.    charpath             only for simplex font
  136.    strokepath           affects entire path; lines will always be
  137.                         one pixel wide
  138.  
  139.           *** painting ***
  140.    erasepage
  141.    fill, stroke
  142.  
  143.       *** character and font ***
  144.    findfont             fonts are simple objects, not dictionaries;
  145.                         'key' can be a string or a name
  146.    scalefont            for Amiga fonts, must be an available size --
  147.                         largest is chosen if not scaled -- and also the
  148.                         font returned is not a new font, just a different
  149.                         size of the same font (for simplex the font is
  150.                         new)
  151.    makefont             only for simplex font
  152.    setfont
  153.    currentfont
  154.    show
  155.    stringwidth          for Amiga fonts, does not take account of scaling
  156.                         or rotation; the y coordinate returned is always 0
  157.  
  158.  
  159.  
  160. Non-standard operators:
  161.  
  162.    i {0-7}         pencolor            set foreground color
  163.    i {0-7}         penbcolor           set background color
  164.    i {0-4}         penmode             jam1, jam2, complement,, inverse
  165.    i               penpattern
  166.                    pixel               set pixel at currentpoint
  167.    i1 i2 i3 i4     box                 display box with top left corner
  168.                                        at (i1,i2) and lower right at (i3,i4)
  169.    any             hex       name      name has value in hex
  170.    i1 i2           flood               fill area surrounding (i1,i2) with
  171.                                        color, to boundaries of same color;
  172.                                        bombs system if area not enclosed
  173.    num             greyline            argument is in range 0 to 1; 0 causes
  174.                                        Amiga line drawing routine to be used
  175.                                        -- other values set the intensity of
  176.                                        lines drawn by an anti-aliasing
  177.                                        routine, which works best when
  178.                                        rgb colors 0 to 3 are progressively
  179.                                        darker or lighter
  180.  
  181. Assembly
  182.  
  183.    ps.a           main procedure
  184.    dict.a         systemdict
  185.    files.a        file io, screen and window initialization
  186.    console.a      console io for interactive window
  187.    ffpa.a         conversion between strings and reals
  188.    lmath.a        32 bit division and multiplication
  189.    control.a      'if', 'repeat', etc.
  190.    rmath.a        'add', 'mul', etc.; resident font routines
  191.    simplex.chr    simplex font data
  192.    graphics.a     graphics operators
  193.  
  194.    ps.h           header for most modules
  195.    ps.link        'with' file for linking
  196.