PS Quick Guide
Syntax:
/procedure_name { }
Example:
/" { 72 mul }
1 " 1.5 " moveto
Would set up " as a procedure to convert from inches to PS points. Then it is used to move 1 inch from left and 1.5 inches from the bottom of the page.
| Operands | Operator | Functionality |
|---|---|---|
| Arithmatic Operations | ||
| n1 n2 | sub | n1-n2 |
| n1 n2 | add | n1+n2 |
| n1 n2 | mul | n1*n2 |
| n1 n2 | div | n1/n2 |
| Global Transformations | ||
| deg | rotate | Rotate next operations by deg degrees |
| x y | translate | Set 0,0 to x,y on the paper |
| x y | scale | Scale x coordinates by x and y by y |
| Atribute Commands | ||
| n | setlinewidth | Set the drawing line width to n |
| % | setgray | Set line briteness.(0=black .5=gray 1=white) |
| Font Commands | ||
| /str | findfont | Set fontname to str if it exists |
| n | scalefont | Set fontsize to n |
| - | setfont | Load font |
| Drawing Commands | ||
| x y | moveto | Set current position to x,y |
| x y | drawto | Draw a line to x,y |
| x y r deg1 deg2 | arc arcn | Draw Arc centered on x,y with radius r from deg1 to deg2 arcn moves clockwise (negative) |
| (str) - | show | Print str at current position Draw a dot (no "(str)") |
| - | closepath | Draw from current position to first in path |
| - | gsave | Save path |
| - | grestore | Restore saved path |
| End Draw Commands | ||
| - | stroke | Actually draws path, and clears path |
| - | fill | Fill in path, and clear it |
| Page End Operation | ||
| - | showpage | Actually print page and eject it. |