0% found this document useful (0 votes)
925 views2 pages

PostScript Quick Reference

This document provides a quick reference to common PostScript operators organized into categories like numerical, stack, graphics state, coordinate system, path construction, painting, device setup, character/font, and control operators. It lists each operator's name and parameters, and in 3 sentences or less describes what each operator does, such as adding or subtracting numerical values, exchanging the top two elements on the stack, setting the line width or cap style, translating, scaling or rotating the coordinate system, constructing paths through moveto, lineto and arc commands, filling or stroking paths, managing pages and fonts, and repeating blocks of code.

Uploaded by

Sneetsher Crispy
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
925 views2 pages

PostScript Quick Reference

This document provides a quick reference to common PostScript operators organized into categories like numerical, stack, graphics state, coordinate system, path construction, painting, device setup, character/font, and control operators. It lists each operator's name and parameters, and in 3 sentences or less describes what each operator does, such as adding or subtracting numerical values, exchanging the top two elements on the stack, setting the line width or cap style, translating, scaling or rotating the coordinate system, constructing paths through moveto, lineto and arc commands, filling or stroking paths, managing pages and fonts, and repeating blocks of code.

Uploaded by

Sneetsher Crispy
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 2

PostScript Quick Reference v2.

0
Numercal operators
num1 num2 add sum num1 + num2
num1 num2 sub difference num1 - num2
num1 num2 mul product num1 * num2
num1 num2 div quotient num1 / num2

Stack operators
any pop - discard top element
any1 any2 exch any2 any1 exchange top two elements
any dup any any duplicate top element

Graphics state operators


- gsave - save graphics state
- grestore - restore graphics state
num setlinewidth - set current line width
num setlinecap - set shape of line ends
(0=butt, 1=round, 2=square)
num setlinejoin - set type of corners
(0=miter, 1=round, 2=bevel)
num setgray - set color to gray value
(0=black to 1=white)

Coordinate system operators


tx ty translate - translate user space
sx sy scale - scale user space
angle rotate - rotate user space

Path construction operators


x y moveto - set current point
dx dy rmoveto - relative moveto
x y lineto - append straight line
dx dy rlineto - relative lineto
x y r ang1 ang2 arc - counterclockwise arc
- newpath - initialize path to empty
- closepath - connect subpath to starting point
string bool charpath - append character outline to path
- currentpoint x y return current point coordinate

1
Painting operators
- stroke - draw line along current path
- fill - fill path with current color
- erasepage - paint current page white

Device setup and output operators


- showpage - output and reset current page
- copypage - output current page

Character and font operators


key findfont font return font dict
font scale scalefont font' scale font to produce new font'
font setfont - set font dictionary
string show - print characters of string

Control operators
init incr lim proc for - execute proc with values from init
by steps of incr to lim
int proc repeat - repeat proc int times

You might also like