home *** CD-ROM | disk | FTP | other *** search
-
- *
- * This program is in the public domain. PostScript is a trademark
- * of Adobe Systems.
- * Greg Lee, July, 1987.
- * U.S. mail: 562 Moore Hall, Dept. of Linguistics
- * University of Hawaii, Honolulu, HI 96822
- * ARPA: uhccux!lee@nosc.ARPA
- *
- PS document
- Greg Lee, April, 1986
-
- Ps emulates PostScript () Adobe Systems), in a small way.
-
- Interactive input and output takes place in a small window.
- The page being composed is shown behind the window in an interlaced
- screen with 16 colors. When input is
- redirected to come from a file with "ps < programfile", the ps program
- in this file is executed before interaction begins.
-
- There is no prompt shown when ps is ready to receive console input.
-
- Default screen coordinates are x = 0 to 639 from the left to the
- right of the screen, and y = 0 to 511 from the bottom to the top
- of the screen. Considering the units to be points,
- that makes the display a nominal 8 8/9" across and 7 1/9" up and down.
-
- Operators do more or less what they do in PostScript, except as
- noted below. See PostScript Language: Reference Manual, Adobe
- Systems Incorporated, Addison-Wesley, 1985.
-
- Ps has one built-in font named 'simplex', which is stroked. (Data
- came from Alan Hershey's data base.)
-
- Types implemented:
-
- integer, real, boolean, string, name, operator
- array, mark, dictionary, save, fontID
-
- Operators:
-
- *** stack manipulation ***
- pop, exch, dup, copy
- index, roll, clear, count
- mark
-
- *** math ***
- add, div, idiv, mod
- mul, sub, abs, neg
- ceiling, floor, round [round gives floor of -ddddd.5]
- truncate, sqrt
- pow, tan, tanh, cosh, sinh (non-standard)
- atan, cos, sin
- exp, ln, log
-
- *** array ***
- array, [, ]
- length, get, put
-
- *** dictionary ***
- dict
- length, maxlength
- begin, end
- def defined operators are simple objects, not arrays;
- "key" must be a name
-
- *** string ***
- string the '<..>' syntax is not implemented
- length, get, put
-
- *** relational, Boolean ***
- eq, ne, ge
- gt, le, lt comparisons for numbers only, not strings
- true, false
-
- *** control ***
- exec leaves anything but an operator on the stack
- if, ifelse
- for integers only
- repeat, loop
- exit
- stop, stopped untested
- countexectack always gives 0, since there is no exec stack
- execstack does nothing
- quit exit to AmigaDos
- start does nothing
-
- *** type, attribute, conversion ***
- cvi, cvr no conversion from strings
- cvs no range-check is done
-
- *** file ***
- file, read, write implemented only for %stdout and %stdin (which
- are always the console)
- run can't nest run files or have 2 'run' commands
- on same line; use in defined procedures will not
- work properly, since 'run' merely redirects input
- print, =
-
- *** virtual memory ***
- save, restore restore merely destroys objects created since
- the last save and reuses the memory space they
- occupied (in addition to doing a grestore)
-
- *** graphics state ***
- gsave, grestore colors are not saved or restored
- setlinewidth you get butt linecaps and bevel joins; the joins
- are not done properly for concave figures; when
- there is non-uniform scaling of the axes, rotation
- of the axes is not taken account of
- currentlinewidth
- setflat, currentflat
- setgray there are only 5 levels of grey available, set by
- argument: n = 0, 0 < n < .25, .25 <= n < .5, .5 <= n
- < .75, .75 <= n <= 1
- currentgray
- setrgbcolor affects only current foreground pen color;
- takes 3 arguments in range 0-15
- currentrgbcolor components of current foreground pen color
-
- *** coordinate system ***
- translate
- scale for Amiga fonts, does not affect sizes of letters;
- moves currentpoint (bug)
- rotate for Amiga fonts, does not affect orientation
- concat, concatmatrix
- transform, dtransform
-
- *** path construction ***
- newpath, currentpoint
- moveto, rmoveto
- lineto, rlineto
- curveto, rcurveto
- closepath
- charpath only for simplex font
- strokepath affects entire path; lines will always be
- one pixel wide
-
- *** painting ***
- erasepage
- fill, stroke
-
- *** character and font ***
- findfont fonts are simple objects, not dictionaries;
- 'key' can be a string or a name
- scalefont for Amiga fonts, must be an available size --
- largest is chosen if not scaled -- and also the
- font returned is not a new font, just a different
- size of the same font (for simplex the font is
- new)
- makefont only for simplex font
- setfont
- currentfont
- show
- stringwidth for Amiga fonts, does not take account of scaling
- or rotation; the y coordinate returned is always 0
-
-
-
- Non-standard operators:
-
- i {0-7} pencolor set foreground color
- i {0-7} penbcolor set background color
- i {0-4} penmode jam1, jam2, complement,, inverse
- i penpattern
- pixel set pixel at currentpoint
- i1 i2 i3 i4 box display box with top left corner
- at (i1,i2) and lower right at (i3,i4)
- any hex name name has value in hex
- i1 i2 flood fill area surrounding (i1,i2) with
- color, to boundaries of same color;
- bombs system if area not enclosed
- num greyline argument is in range 0 to 1; 0 causes
- Amiga line drawing routine to be used
- -- other values set the intensity of
- lines drawn by an anti-aliasing
- routine, which works best when
- rgb colors 0 to 3 are progressively
- darker or lighter
-
- Assembly
-
- ps.a main procedure
- dict.a systemdict
- files.a file io, screen and window initialization
- console.a console io for interactive window
- ffpa.a conversion between strings and reals
- lmath.a 32 bit division and multiplication
- control.a 'if', 'repeat', etc.
- rmath.a 'add', 'mul', etc.; resident font routines
- simplex.chr simplex font data
- graphics.a graphics operators
-
- ps.h header for most modules
- ps.link 'with' file for linking
-
-