Created
April 22, 2025 16:32
-
-
Save nst/4ac34ca593cf8b854a6a6c6a096fb8f8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>PostScript Operators</title> | |
<style> | |
body { | |
font-family: sans-serif; | |
margin: 20px; | |
max-width: 100%; | |
} | |
h1 { | |
color: #333; | |
margin-bottom: 15px; | |
font-size: 24px; | |
} | |
#search-input { | |
padding: 8px; | |
width: 100%; | |
max-width: 300px; | |
margin-bottom: 15px; | |
border: 1px solid #ccc; | |
border-radius: 4px; | |
} | |
.operator-table { | |
width: 100%; | |
border-collapse: collapse; | |
} | |
.operator-table th, .operator-table td { | |
border: 1px solid #ddd; | |
padding: 8px; | |
word-wrap: break-word; | |
vertical-align: top; | |
} | |
.operator-table th { | |
background-color: #f0f0f0; | |
} | |
.operator-table tr:nth-child(even) { | |
background-color: #f9f9f9; | |
} | |
.category-separator { | |
font-weight: bold; | |
background-color: #eee; | |
text-align: left; | |
} | |
.operands-column { | |
width: 25%; | |
text-align: right; | |
} | |
.operator-column { | |
width: 20%; | |
font-weight: bold; | |
text-align: center; | |
} | |
.results-column { | |
width: 20%; | |
} | |
.description-column { | |
width: 35%; | |
white-space: pre-line; | |
} | |
@media (max-width: 768px) { | |
.operator-table { | |
font-size: 14px; | |
} | |
.operator-table th, .operator-table td { | |
padding: 6px 4px; | |
} | |
} | |
@media (max-width: 480px) { | |
.operator-table { | |
font-size: 12px; | |
} | |
.operator-row { | |
display: grid; | |
grid-template-columns: repeat(3, 1fr); | |
grid-template-areas: | |
"operands operator results" | |
"description description description"; | |
border: 1px solid #ddd; | |
margin-bottom: 10px; | |
} | |
.operator-table th { | |
display: none; | |
} | |
.category-separator { | |
display: block; | |
padding: 8px; | |
margin: 10px 0; | |
border-radius: 4px; | |
} | |
.operands-column { | |
grid-area: operands; | |
text-align: left; | |
border: none; | |
width: 100%; | |
} | |
.operator-column { | |
grid-area: operator; | |
border: none; | |
width: 100%; | |
} | |
.results-column { | |
grid-area: results; | |
border: none; | |
width: 100%; | |
} | |
.description-column { | |
grid-area: description; | |
border-top: 1px solid #ddd; | |
padding-top: 8px; | |
font-style: italic; | |
width: 100%; | |
} | |
/* Fix for PRE element size */ | |
.description-column pre { | |
font-size: 11px; | |
margin: 5px 0; | |
padding: 4px; | |
background-color: #f5f5f5; | |
border-radius: 3px; | |
overflow-x: auto; | |
} | |
/* No labels in small mode */ | |
} | |
</style> | |
</head> | |
<body> | |
<h1>PostScript Operators Reference</h1> | |
<input type="text" id="search-input" onkeyup="searchOperators()" placeholder="Search operators..."> | |
<table class="operator-table" id="all-operators-table"> | |
<thead> | |
<tr> | |
<th class="operands-column">Operands</th> | |
<th class="operator-column">Operator</th> | |
<th class="results-column">Results</th> | |
<th class="description-column">Description</th> | |
</tr> | |
</thead> | |
<tbody id="operators-tbody"> | |
</tbody> | |
</table> | |
<p><i>Based on Adobe PostScript ® Language Reference Manual (2nd Edition, 1990).</i></p> | |
<script> | |
const operatorsData = { | |
"Operand Stack Manipulation Operators": [ | |
{ | |
"operator": "pop", | |
"operands": "any", | |
"results": "", | |
"description": "discard top element<BR><PRE>1 2 3 pop ⇒ 1 2<BR>1 2 3 pop pop ⇒ 1</PRE>" | |
}, | |
{ | |
"operator": "exch", | |
"operands": "any1 any2", | |
"results": "any2 any1", | |
"description": "exchange top two elements<BR><PRE>1 2 exch ⇒ 2 1</PRE>" | |
}, | |
{ | |
"operator": "dup", | |
"operands": "any", | |
"results": "any any", | |
"description": "duplicate top element" | |
}, | |
{ | |
"operator": "copy", | |
"operands": "any1 ... anyn n", | |
"results": "any1 ... anyn any1 ... anyn", | |
"description": "duplicate top n elements <BR><PRE>1 2 3 2 copy ⇒ 1 2 3 2 3<BR>1 2 3 0 copy ⇒ 1 2 3</PRE>" | |
}, | |
{ | |
"operator": "index", | |
"operands": "anyn ... any0 n", | |
"results": "anyn ... any0 anyn", | |
"description": "duplicate arbitrary element<BR><PRE>(a)(b)(c)(d) 0 index ⇒ (a)(b)(c)(d)(d)<BR>(a)(b)(c)(d) 3 index ⇒ (a)(b)(c)(d)(a)</PRE>" | |
}, | |
{ | |
"operator": "roll", | |
"operands": "a n-1 ... a 0 n j", | |
"results": "a(j-1) mod n ... a 0 a n-1 ... a j mod n", | |
"description": "roll n elements up j times <BR><PRE>(a)(b)(c) 3 –1 roll ⇒ (b)(c)(a)<BR>(a)(b)(c) 3 1 roll ⇒ (c)(a)(b)<BR>(a)(b)(c) 3 0 roll ⇒ (a)(b)(c)</PRE>" | |
}, | |
{ | |
"operator": "clear", | |
"operands": "any1 ... anyn", | |
"results": "", | |
"description": "discard all elements" | |
}, | |
{ | |
"operator": "count", | |
"operands": "any1 ... anyn", | |
"results": "any1 ... anyn n", | |
"description": "count elements on stack" | |
}, | |
{ | |
"operator": "mark", | |
"operands": "", | |
"results": "mark", | |
"description": "push mark on stack" | |
}, | |
{ | |
"operator": "cleartomark", | |
"operands": "mark obj1 ... obj n", | |
"results": "", | |
"description": "discard elements down through mark" | |
}, | |
{ | |
"operator": "counttomark", | |
"operands": "mark obj1 ... obj n", | |
"results": "mark obj1 ... obj n n", | |
"description": "count elements down to mark <BR><PRE>1 mark 2 3 counttomark ⇒ 1 mark 2 3 2<BR>1 mark counttomark ⇒ 1 mark 0</PRE>" | |
} | |
], | |
"Arithmetic and Math Operators": [ | |
{ | |
"operator": "add", | |
"operands": "num1 num2", | |
"results": "sum", | |
"description": "num1 plus num2" | |
}, | |
{ | |
"operator": "div", | |
"operands": "num1 num2", | |
"results": "quotient", | |
"description": "num1 divided by num2" | |
}, | |
{ | |
"operator": "idiv", | |
"operands": "int1 int2", | |
"results": "quotient", | |
"description": "integer divide<BR><PRE>3 2 idiv ⇒ 1<BR>4 2 idiv ⇒ 2<BR>–5 2 idiv ⇒ –2</PRE>" | |
}, | |
{ | |
"operator": "mod", | |
"operands": "int1 int2", | |
"results": "remainder", | |
"description": "int1 mod int2<BR><PRE>5 3 mod ⇒ 2<BR>5 2 mod ⇒ 1<BR>–5 3 mod ⇒ –2</PRE>" | |
}, | |
{ | |
"operator": "mul", | |
"operands": "num1 num2", | |
"results": "product", | |
"description": "num1 times num2" | |
}, | |
{ | |
"operator": "sub", | |
"operands": "num1 num2", | |
"results": "difference", | |
"description": "num1 minus num2" | |
}, | |
{ | |
"operator": "abs", | |
"operands": "num1", | |
"results": "num2", | |
"description": "absolute value of num1" | |
}, | |
{ | |
"operator": "neg", | |
"operands": "num1", | |
"results": "num2", | |
"description": "negative of num1<BR><PRE>4.5 neg ⇒ –4.5<BR>–3 neg ⇒ 3</PRE>" | |
}, | |
{ | |
"operator": "ceiling", | |
"operands": "num1", | |
"results": "num2", | |
"description": "ceiling of num1 <BR><PRE>3.2 ceiling ⇒ 4.0<BR>–4.8 ceiling ⇒ –4.0<BR>99 ceiling ⇒ 99</PRE>" | |
}, | |
{ | |
"operator": "floor", | |
"operands": "num1", | |
"results": "num2", | |
"description": "floor of num1<BR><PRE>3.2 floor ⇒ 3.0<BR>–4.8 floor ⇒ –5.0<BR>99 floor ⇒ 99</PRE>" | |
}, | |
{ | |
"operator": "round", | |
"operands": "num1", | |
"results": "num2", | |
"description": "round num1 to nearest integer<BR><PRE>3.2 round ⇒ 3.0<BR>6.5 round ⇒ 7.0<BR>–4.8 round ⇒ –5.0<BR>–6.5 round ⇒ –6.0<BR>99 round ⇒ 99</PRE>" | |
}, | |
{ | |
"operator": "truncate", | |
"operands": "num1", | |
"results": "num2", | |
"description": "remove fractional part of num1<BR><PRE>3.2 truncate ⇒ 3.0<BR>–4.8 truncate ⇒ –4.0<BR>99 truncate ⇒ 99</PRE>" | |
}, | |
{ | |
"operator": "sqrt", | |
"operands": "num", | |
"results": "real", | |
"description": "square root of num" | |
}, | |
{ | |
"operator": "atan", | |
"operands": "num den", | |
"results": "angle", | |
"description": "arctangent of num/den in degrees" | |
}, | |
{ | |
"operator": "cos", | |
"operands": "angle", | |
"results": "real", | |
"description": "cosine of angle (degrees)" | |
}, | |
{ | |
"operator": "sin", | |
"operands": "angle", | |
"results": "real", | |
"description": "sine of angle (degrees)" | |
}, | |
{ | |
"operator": "exp", | |
"operands": "base exponent", | |
"results": "real", | |
"description": "raise base to exponent power<BR><PRE>9 0.5 exp ⇒ 3.0<BR>–9 –1 exp ⇒ –0.111111</PRE>" | |
}, | |
{ | |
"operator": "ln", | |
"operands": "num", | |
"results": "real", | |
"description": "natural logarithm (base e)<BR><PRE>10 ln ⇒ 2.30259<BR>100 ln ⇒ 4.60517</PRE>" | |
}, | |
{ | |
"operator": "log", | |
"operands": "num", | |
"results": "real", | |
"description": "logarithm (base 10)<BR><PRE>10 log ⇒ 1.0<BR>100 log ⇒ 2.0</PRE>" | |
}, | |
{ | |
"operator": "rand", | |
"operands": "", | |
"results": "int", | |
"description": "generate pseudo-random integer" | |
}, | |
{ | |
"operator": "srand", | |
"operands": "int", | |
"results": "", | |
"description": "set random number seed" | |
}, | |
{ | |
"operator": "rrand", | |
"operands": "", | |
"results": "int", | |
"description": "return random number seed" | |
} | |
], | |
"Array Operators": [ | |
{ | |
"operator": "array", | |
"operands": "int", | |
"results": "array", | |
"description": "create array of length int" | |
}, | |
{ | |
"operator": "[", | |
"operands": "", | |
"results": "mark", | |
"description": "start array construction" | |
}, | |
{ | |
"operator": "]", | |
"operands": "mark obj0 ... obj n-1", | |
"results": "array", | |
"description": "end array construction" | |
}, | |
{ | |
"operator": "length", | |
"operands": "array", | |
"results": "int", | |
"description": "number of elements in array<BR><PRE>[1 2 4] length ⇒ 3<BR>[ ] length ⇒ 0 % An array of zero length<BR>/ar 20 array def ar length ⇒ 20</PRE>" | |
}, | |
{ | |
"operator": "get", | |
"operands": "array index", | |
"results": "any", | |
"description": "get array element indexed by index<BR><PRE>[31 41 59] 0 get ⇒ 31<BR>[0 (a mixed-type array) [ ] {add 2 div}]<BR>2 get ⇒ [ ] % An empty array</PRE>" | |
}, | |
{ | |
"operator": "put", | |
"operands": "array index any", | |
"results": "", | |
"description": "put any into array at index<BR><PRE>/ar [5 17 3 8] def<BR>ar 2 (abcd) put<BR>ar ⇒ [5 17 (abcd) 8]</PRE>" | |
}, | |
{ | |
"operator": "getinterval", | |
"operands": "array index count", | |
"results": "subarray", | |
"description": "subarray of array starting at index for count elements<BR><PRE>[9 8 7 6 5] 1 3 getinterval ⇒ [8 7 6]</PRE>" | |
}, | |
{ | |
"operator": "putinterval", | |
"operands": "array1 index array2", | |
"results": "", | |
"description": "replace subarray of array1 starting at index by array2<BR><PRE>/ar [5 8 2 7 3] def<BR>ar 1 [(a) (b) (c)] putinterval<BR>ar ⇒ [5 (a) (b) (c) 3]</PRE>" | |
}, | |
{ | |
"operator": "astore", | |
"operands": "any0 ... anyn-1 array", | |
"results": "array", | |
"description": "pop elements from stack into array <BR><PRE>(a) (bcd) (ef) 3 array astore ⇒ [(a) (bcd) (ef)]</PRE>" | |
}, | |
{ | |
"operator": "aload", | |
"operands": "array", | |
"results": "a0 ... an-1 array", | |
"description": "push all elements of array on stack <BR> <PRE>[23 (ab) –6] aload ⇒ 23 (ab) –6 [23 (ab) –6]</PRE>" | |
}, | |
{ | |
"operator": "copy", | |
"operands": "array1 array2", | |
"results": "subarray2", | |
"description": "copy elements of array1 to initial subarray of array2 <BR><PRE>/a1 [1 2 3] def<BR>a1 dup length array copy ⇒ [1 2 3]</PRE>" | |
}, | |
{ | |
"operator": "forall", | |
"operands": "array proc", | |
"results": "", | |
"description": "execute proc for each element of array" | |
} | |
], | |
"Packed Array Operators": [ | |
{ | |
"operator": "packedarray", | |
"operands": "any0 ... anyn-1 n", | |
"results": "packedarray", | |
"description": "create packed array consisting of the specified n elements" | |
}, | |
{ | |
"operator": "currentpacking", | |
"operands": "", | |
"results": "bool", | |
"description": "return array packing mode" | |
}, | |
{ | |
"operator": "setpacking", | |
"operands": "bool", | |
"results": "", | |
"description": "set array packing mode for {...} syntax (true = packedarray)<BR><PRE>systemdict /setpacking known<BR>{/savepacking currentpacking def<BR>true setpacking<BR>} if<BR>...Arbitrary procedure definitions...<BR>systemdict /setpacking known {savepacking setpacking} if</PRE>" | |
}, | |
{ | |
"operator": "length", | |
"operands": "packedarray", | |
"results": "int", | |
"description": "number of elements in packedarray" | |
}, | |
{ | |
"operator": "get", | |
"operands": "packedarray index", | |
"results": "any", | |
"description": "get packedarray element indexed by index" | |
}, | |
{ | |
"operator": "getinterval", | |
"operands": "packedarray index count", | |
"results": "subarray", | |
"description": "subarray of packedarray starting at index for count elements" | |
}, | |
{ | |
"operator": "aload", | |
"operands": "packedarray", | |
"results": "a0 ... an-1 packedarray", | |
"description": "push all elements of packedarray on stack" | |
}, | |
{ | |
"operator": "copy", | |
"operands": "packedarray1 array2", | |
"results": "subarray2", | |
"description": "copy elements of packedarray1 to initial subarray of array2" | |
}, | |
{ | |
"operator": "forall", | |
"operands": "packedarray proc", | |
"results": "", | |
"description": "execute proc for each element of packedarray" | |
} | |
], | |
"Dictionary Operators": [ | |
{ | |
"operator": "dict", | |
"operands": "int", | |
"results": "dict", | |
"description": "create dictionary with capacity for int elements" | |
}, | |
{ | |
"operator": "<<", | |
"operands": "", | |
"results": "mark", | |
"description": "start dictionary construction" | |
}, | |
{ | |
"operator": ">>", | |
"operands": "mark key1 value1 ... keyn valuen", | |
"results": "dict", | |
"description": "end dictionary construction" | |
}, | |
{ | |
"operator": "length", | |
"operands": "dict", | |
"results": "int", | |
"description": "number of key-value pairs in dict<BR><PRE><BR>/mydict 5 dict def<BR>mydict length ⇒ 0<BR>mydict /firstkey (firstvalue) put<BR>mydict length ⇒ 1</PRE>" | |
}, | |
{ | |
"operator": "maxlength", | |
"operands": "dict", | |
"results": "int", | |
"description": "current capacity of dict<BR><PRE>/mydict 5 dict def<BR>mydict length ⇒ 0<BR>mydict maxlength ⇒ 5</PRE>" | |
}, | |
{ | |
"operator": "begin", | |
"operands": "dict", | |
"results": "", | |
"description": "push dict on dictionary stack" | |
}, | |
{ | |
"operator": "end", | |
"operands": "", | |
"results": "", | |
"description": "pop dictionary stack" | |
}, | |
{ | |
"operator": "def", | |
"operands": "key value", | |
"results": "", | |
"description": "associate key and value in current dictionary<BR><PRE>/ncnt 1 def % Define ncnt to be 1 in current dict<BR>/ncnt ncnt 1 add def % ncnt now has value 2</PRE>" | |
}, | |
{ | |
"operator": "load", | |
"operands": "key", | |
"results": "value", | |
"description": "search dictionary stack for key and return associated value<BR><PRE>/avg {add 2 div} def<BR>/avg load ⇒ {add 2 div}</PRE>" | |
}, | |
{ | |
"operator": "store", | |
"operands": "key value", | |
"results": "", | |
"description": "replace topmost definition of key<BR><PRE>abc 123 store<BR>/abc where { } {currentdict} ifelse /abc 123 put</PRE>" | |
}, | |
{ | |
"operator": "get", | |
"operands": "dict key", | |
"results": "any", | |
"description": "get value associated with key in dict<BR><PRE>/mykey (myvalue) def<BR>currentdict /mykey get ⇒ (myvalue)</PRE>" | |
}, | |
{ | |
"operator": "put", | |
"operands": "dict key value", | |
"results": "", | |
"description": "associate key with value in dict<BR><PRE>/d 5 dict def<BR>d /abc 123 put<BR>d {} forall ⇒ /abc 123</PRE>" | |
}, | |
{ | |
"operator": "undef", | |
"operands": "dict key", | |
"results": "", | |
"description": "remove key and its value from dict" | |
}, | |
{ | |
"operator": "known", | |
"operands": "dict key", | |
"results": "bool", | |
"description": "test whether key is in dict<BR><PRE>/mydict 5 dict def<BR>mydict /total 0 put<BR>mydict /total known ⇒ true<BR>mydict /badname known ⇒ false</PRE>" | |
}, | |
{ | |
"operator": "where", | |
"operands": "key", | |
"results": "dict true", | |
"description": "find dictionary in which key is defined or false" | |
}, | |
{ | |
"operator": "copy", | |
"operands": "dict1 dict2", | |
"results": "dict2", | |
"description": "copy contents of dict1 to dict2" | |
}, | |
{ | |
"operator": "forall", | |
"operands": "dict proc", | |
"results": "", | |
"description": "execute proc for each element of dict" | |
}, | |
{ | |
"operator": "currentdict", | |
"operands": "", | |
"results": "dict", | |
"description": "push current dictionary on operand stack" | |
}, | |
{ | |
"operator": "errordict", | |
"operands": "", | |
"results": "dict", | |
"description": "error handler dictionary" | |
}, | |
{ | |
"operator": "$error", | |
"operands": "", | |
"results": "dict", | |
"description": "error control and status dictionary" | |
}, | |
{ | |
"operator": "systemdict", | |
"operands": "", | |
"results": "dict", | |
"description": "system dictionary" | |
}, | |
{ | |
"operator": "userdict", | |
"operands": "", | |
"results": "dict", | |
"description": "writable dictionary in local VM" | |
}, | |
{ | |
"operator": "globaldict", | |
"operands": "", | |
"results": "dict", | |
"description": "writable dictionary in global VM" | |
}, | |
{ | |
"operator": "statusdict", | |
"operands": "", | |
"results": "dict", | |
"description": "product-dependent dictionary" | |
}, | |
{ | |
"operator": "countdictstack", | |
"operands": "", | |
"results": "int", | |
"description": "count elements on dictionary stack" | |
}, | |
{ | |
"operator": "dictstack", | |
"operands": "array", | |
"results": "subarray", | |
"description": "copy dictionary stack into array" | |
}, | |
{ | |
"operator": "cleardictstack", | |
"operands": "", | |
"results": "", | |
"description": "pop all non-permanent dictionaries off dictionary stack" | |
} | |
], | |
"String Operators": [ | |
{ | |
"operator": "string", | |
"operands": "int", | |
"results": "string", | |
"description": "create string of length int" | |
}, | |
{ | |
"operator": "length", | |
"operands": "string", | |
"results": "int", | |
"description": "number of elements in string<BR><PRE>(abc\\n) length ⇒ 4 % The “\\n” is one character<BR>() length ⇒ 0 % No characters between ( and ) <BR>/foo length ⇒ 3</PRE>" | |
}, | |
{ | |
"operator": "get", | |
"operands": "string index", | |
"results": "int", | |
"description": "get string element indexed by index<BR><PRE><BR>(abc) 1 get ⇒ 98 % Character code for “b”<BR>(a) 0 get ⇒ 97</PRE>" | |
}, | |
{ | |
"operator": "put", | |
"operands": "string index int", | |
"results": "", | |
"description": "put int into string at index<BR><PRE><BR>/st (abc) def<BR>st 0 65 put % 65 is ASCII code for character “A”<BR>st ⇒ (Abc)</PRE>" | |
}, | |
{ | |
"operator": "getinterval", | |
"operands": "string index count", | |
"results": "substring", | |
"description": "substring of string starting at index for count elements<BR><PRE>(abcde) 1 3 getinterval ⇒ (bcd)<BR>(abcde) 0 0 getinterval ⇒ () % An empty string</PRE>" | |
}, | |
{ | |
"operator": "putinterval", | |
"operands": "string1 index string2", | |
"results": "", | |
"description": "replace substring of string1 starting at index by string2<BR><PRE>/st (abc) def<BR>st 1 (de) putinterval<BR>st ⇒ (ade)</PRE>" | |
}, | |
{ | |
"operator": "copy", | |
"operands": "string1 string2", | |
"results": "substring2", | |
"description": "copy elements of string1 to initial substring of string2" | |
}, | |
{ | |
"operator": "forall", | |
"operands": "string proc", | |
"results": "", | |
"description": "execute proc for each element of string<BR><PRE>0 [13 29 3 –8 21] {add} forall ⇒ 58<BR>/d 2 dict def<BR>d /abc 123 put<BR>d /xyz (test) put<BR>d {} forall ⇒ /xyz (test) /abc 123</PRE>" | |
}, | |
{ | |
"operator": "anchorsearch", | |
"operands": "string seek", | |
"results": "post match true", | |
"description": "determine if seek is initial substring of string or string false <BR> <PRE>(abbc) (ab) anchorsearch ⇒ (bc) (ab) true<BR>(abbc) (bb) anchorsearch ⇒ (abbc) false<BR>(abbc) (bc) anchorsearch ⇒ (abbc) false<BR>(abbc) (B) anchorsearch ⇒ (abbc) false</PRE>" | |
}, | |
{ | |
"operator": "search", | |
"operands": "string seek", | |
"results": "post match pre true", | |
"description": "search for seek in string or string false<BR><PRE>(abbc) (ab) search ⇒ (bc) (ab) ( ) true<BR>(abbc) (bb) search ⇒ (c) (bb) (a) true<BR>(abbc) (bc) search ⇒ () (bc) (ab) true<BR>(abbc) (B) search ⇒ (abbc) false</PRE>" | |
}, | |
{ | |
"operator": "token", | |
"operands": "string", | |
"results": "post token true", | |
"description": "read token from start of string or false<BR><PRE>(15(St1) {1 2 add}) token ⇒ ((St1) {1 2 add}) 15 true<BR>((St1) {1 2 add}) token ⇒ ( {1 2 add}) (St1) true<BR>( {1 2 add}) token ⇒ () {1 2 add} true<BR>() token ⇒ false</PRE>" | |
} | |
], | |
"Relational, Boolean, and Bitwise Operators": [ | |
{ | |
"operator": "eq", | |
"operands": "any1 any2", | |
"results": "bool", | |
"description": "test equal <BR><PRE>4.0 4 eq ⇒ true % A real and an integer may be equal<BR>(abc) (abc) eq ⇒ true % Strings with equal elements are equal<BR>(abc) /abc eq ⇒ true % A string and a name may be equal<BR>[1 2 3] dup eq ⇒ true % An array is equal to itself<BR>[1 2 3] [1 2 3] eq ⇒ false % Distinct array objects not equal</PRE>" | |
}, | |
{ | |
"operator": "ne", | |
"operands": "any1 any2", | |
"results": "bool", | |
"description": "test not equal" | |
}, | |
{ | |
"operator": "ge", | |
"operands": "num1|str1 num2|str2", | |
"results": "bool", | |
"description": "test greater or equal<BR><PRE>4.2 4 ge ⇒ true<BR>(abc)(d) ge ⇒ false<BR>(aba)(ab) ge ⇒ true<BR>(aba)(aba) ge ⇒ true</PRE>" | |
}, | |
{ | |
"operator": "gt", | |
"operands": "num1|str1 num2|str2", | |
"results": "bool", | |
"description": "test greater than" | |
}, | |
{ | |
"operator": "le", | |
"operands": "num1|str1 num2|str2", | |
"results": "bool", | |
"description": "test less or equal" | |
}, | |
{ | |
"operator": "lt", | |
"operands": "num1|str1 num2|str2", | |
"results": "bool", | |
"description": "test less than" | |
}, | |
{ | |
"operator": "and", | |
"operands": "bool1|int1 bool2|int2", | |
"results": "bool3|int3", | |
"description": "logical | bitwise and" | |
}, | |
{ | |
"operator": "not", | |
"operands": "bool1|int1", | |
"results": "bool2|int2", | |
"description": "logical | bitwise not<BR><PRE>true not ⇒ false % A complete truth table<BR>false not ⇒ true<BR>52 not ⇒ –53</PRE>" | |
}, | |
{ | |
"operator": "or", | |
"operands": "bool1|int1 bool2|int2", | |
"results": "bool3|int3", | |
"description": "logical | bitwise inclusive or<BR><PRE>true true or ⇒ true % A complete truth table<BR>true false or ⇒ true<BR>false true or ⇒ true<BR>false false or ⇒ false<BR><BR>17 5 or ⇒ 21</PRE>" | |
}, | |
{ | |
"operator": "xor", | |
"operands": "bool1|int1 bool2|int2", | |
"results": "bool3|int3", | |
"description": "logical | bitwise exclusive or<BR><PRE>true true xor ⇒ false true false xor ⇒ true % A complete truth table<BR>false true xor ⇒ true<BR>false false xor ⇒ false<BR><BR>7 3 xor ⇒ 4<BR>12 3 xor ⇒ 15</PRE>" | |
}, | |
{ | |
"operator": "true", | |
"operands": "", | |
"results": "true", | |
"description": "push boolean value true" | |
}, | |
{ | |
"operator": "false", | |
"operands": "", | |
"results": "false", | |
"description": "push boolean value false" | |
}, | |
{ | |
"operator": "bitshift", | |
"operands": "int1 shift", | |
"results": "int2", | |
"description": "bitwise shift of int1 (positive is left) <BR><PRE>7 3 bitshift ⇒ 56<BR>142 –3 bitshift ⇒ 17</PRE>" | |
} | |
], | |
"Control Operators": [ | |
{ | |
"operator": "exec", | |
"operands": "any", | |
"results": "", | |
"description": "execute arbitrary object<BR><PRE>(3 2 add) cvx exec ⇒ 5<BR>3 2 /add exec ⇒ 3 2 /add<BR>3 2 /add cvx exec ⇒ 5</PRE>" | |
}, | |
{ | |
"operator": "if", | |
"operands": "bool proc", | |
"results": "", | |
"description": "execute proc if bool is true<BR><PRE>3 4 lt {(3 is less than 4)} if ⇒ (3 is less than 4)</PRE>" | |
}, | |
{ | |
"operator": "ifelse", | |
"operands": "bool proc1 proc2", | |
"results": "", | |
"description": "execute proc1 if bool is true, proc2 if bool is false<BR><PRE>4 3 lt {(TruePart)} {(FalsePart)} ifelse ⇒ (FalsePart) % Since 4 is not less than 3</PRE>" | |
}, | |
{ | |
"operator": "for", | |
"operands": "init incr limit proc", | |
"results": "", | |
"description": "execute proc with values from init by steps of incr to limit<BR><PRE>0 1 1 4 {add} for ⇒ 10<BR>1 2 6 { } for ⇒ 1 3 5<BR>3 –.5 1 { } for ⇒ 3.0 2.5 2.0 1.5 1.0</PRE>" | |
}, | |
{ | |
"operator": "repeat", | |
"operands": "int proc", | |
"results": "", | |
"description": "execute proc int times<BR><PRE>4 {(abc)} repeat ⇒ (abc)(abc)(abc)(abc)<BR>2 3 4 3 {pop} repeat ⇒ 1 % Pops 3 values (down to the 1)<BR>4 {} repeat ⇒ % Does nothing four times<BR>mark 0 {(won’t happen)} repeat ⇒ mark</PRE>" | |
}, | |
{ | |
"operator": "loop", | |
"operands": "proc", | |
"results": "", | |
"description": "execute proc an indefinite number of times" | |
}, | |
{ | |
"operator": "exit", | |
"operands": "", | |
"results": "", | |
"description": "exit innermost active loop" | |
}, | |
{ | |
"operator": "stop", | |
"operands": "", | |
"results": "", | |
"description": "terminate stopped context" | |
}, | |
{ | |
"operator": "stopped", | |
"operands": "any", | |
"results": "bool", | |
"description": "establish context for catching stop" | |
}, | |
{ | |
"operator": "countexecstack", | |
"operands": "", | |
"results": "int", | |
"description": "count elements on exec stack" | |
}, | |
{ | |
"operator": "execstack", | |
"operands": "array", | |
"results": "subarray", | |
"description": "copy exec stack into array" | |
}, | |
{ | |
"operator": "quit", | |
"operands": "", | |
"results": "", | |
"description": "terminate interpreter" | |
}, | |
{ | |
"operator": "start", | |
"operands": "", | |
"results": "", | |
"description": "executed at interpreter startup" | |
} | |
], | |
"Type, Attribute, and Conversion Operators": [ | |
{ | |
"operator": "type", | |
"operands": "any", | |
"results": "name", | |
"description": "return name identifying the type of any" | |
}, | |
{ | |
"operator": "cvlit", | |
"operands": "any", | |
"results": "any", | |
"description": "make object be literal" | |
}, | |
{ | |
"operator": "cvx", | |
"operands": "any", | |
"results": "any", | |
"description": "make object be executable" | |
}, | |
{ | |
"operator": "xcheck", | |
"operands": "any", | |
"results": "bool", | |
"description": "test executable attribute" | |
}, | |
{ | |
"operator": "executeonly", | |
"operands": "array|packedarray|file|string", | |
"results": "array|packedarray|file|string", | |
"description": "reduce access to execute-only" | |
}, | |
{ | |
"operator": "noaccess", | |
"operands": "array|packedarray|dict|file|string", | |
"results": "array|packedarray|dict|file|string", | |
"description": "disallow any access" | |
}, | |
{ | |
"operator": "readonly", | |
"operands": "array|packedarray|dict|file|string", | |
"results": "array|packedarray|dict|file|string", | |
"description": "reduce access to read-only" | |
}, | |
{ | |
"operator": "rcheck", | |
"operands": "array|packedarray|dict|file|string", | |
"results": "bool", | |
"description": "test read access" | |
}, | |
{ | |
"operator": "wcheck", | |
"operands": "array|packedarray|dict|file|string", | |
"results": "bool", | |
"description": "test write access" | |
}, | |
{ | |
"operator": "cvi", | |
"operands": "num|string", | |
"results": "int", | |
"description": "convert to integer<BR><PRE>(3.3E1) cvi ⇒ 33<BR>–47.8 cvi ⇒ –47<BR>520.9 cvi ⇒ 520</PRE>" | |
}, | |
{ | |
"operator": "cvn", | |
"operands": "string", | |
"results": "name", | |
"description": "convert to name<BR><PRE>(abc) cvn ⇒ /abc<BR>(abc) cvx cvn ⇒ abc</PRE>" | |
}, | |
{ | |
"operator": "cvr", | |
"operands": "num|string", | |
"results": "real", | |
"description": "convert to real" | |
}, | |
{ | |
"operator": "cvrs", | |
"operands": "num radix string", | |
"results": "substring", | |
"description": "convert to string with radix<BR><PRE>/temp 12 string def<BR>123 10 temp cvrs ⇒ (123)<BR>–123 10 temp cvrs ⇒ (–123)<BR>123.4 10 temp cvrs ⇒ (123.4)<BR>123 16 temp cvrs ⇒ (7B)<BR>–123 16 temp cvrs ⇒ (FFFFFF85)<BR>123.4 16 temp cvrs ⇒ (7B)</PRE>" | |
}, | |
{ | |
"operator": "cvs", | |
"operands": "any string", | |
"results": "substring", | |
"description": "convert to string<BR><PRE>/str 20 string def<BR>123 456 add str cvs ⇒ (579)<BR>mark str cvs ⇒ (--nostringval--)</PRE>" | |
} | |
], | |
"File Operators": [ | |
{ | |
"operator": "file", | |
"operands": "string1 string2", | |
"results": "file", | |
"description": "open file identified by string1 with access string2<BR><PRE>(%stdin) (r) file ⇒ % standard input file object<BR>(myfile) (w) file ⇒ % output file object, writing to named file</PRE>" | |
}, | |
{ | |
"operator": "filter", | |
"operands": "src|tgt param1 ... paramn name", | |
"results": "file", | |
"description": "establish filtered file" | |
}, | |
{ | |
"operator": "closefile", | |
"operands": "file", | |
"results": "", | |
"description": "close file" | |
}, | |
{ | |
"operator": "read", | |
"operands": "file", | |
"results": "int true", | |
"description": "read one character from file or false" | |
}, | |
{ | |
"operator": "write", | |
"operands": "file int", | |
"results": "", | |
"description": "write one character to file" | |
}, | |
{ | |
"operator": "readhexstring", | |
"operands": "file string", | |
"results": "substring bool", | |
"description": "read hex from file into string" | |
}, | |
{ | |
"operator": "writehexstring", | |
"operands": "file string", | |
"results": "", | |
"description": "write string to file as hex" | |
}, | |
{ | |
"operator": "readstring", | |
"operands": "file string", | |
"results": "substring bool", | |
"description": "read string from file" | |
}, | |
{ | |
"operator": "writestring", | |
"operands": "file string", | |
"results": "", | |
"description": "write string to file" | |
}, | |
{ | |
"operator": "readline", | |
"operands": "file string", | |
"results": "substring bool", | |
"description": "read line from file into string" | |
}, | |
{ | |
"operator": "token", | |
"operands": "file", | |
"results": "token true", | |
"description": "read token from file or false" | |
}, | |
{ | |
"operator": "bytesavailable", | |
"operands": "file", | |
"results": "int", | |
"description": "number of bytes available to read" | |
}, | |
{ | |
"operator": "flush", | |
"operands": "", | |
"results": "", | |
"description": "send buffered data to standard output file" | |
}, | |
{ | |
"operator": "flushfile", | |
"operands": "file", | |
"results": "", | |
"description": "send buffered data or read to EOF" | |
}, | |
{ | |
"operator": "resetfile", | |
"operands": "file", | |
"results": "", | |
"description": "discard buffered characters" | |
}, | |
{ | |
"operator": "status", | |
"operands": "file", | |
"results": "bool", | |
"description": "return status of file" | |
}, | |
{ | |
"operator": "status", | |
"operands": "string", | |
"results": "pages bytes referenced created true", | |
"description": "return information about named file or false" | |
}, | |
{ | |
"operator": "run", | |
"operands": "string", | |
"results": "", | |
"description": "execute contents of named file" | |
}, | |
{ | |
"operator": "currentfile", | |
"operands": "", | |
"results": "file", | |
"description": "return file currently being executed<BR><PRE>/str 100 string def<BR>currentfile str readline<BR>here is a line of text<BR>pop /textline exch def</PRE>" | |
}, | |
{ | |
"operator": "deletefile", | |
"operands": "string", | |
"results": "", | |
"description": "delete named file" | |
}, | |
{ | |
"operator": "renamefile", | |
"operands": "string1 string2", | |
"results": "", | |
"description": "rename file string1 to string2" | |
}, | |
{ | |
"operator": "filenameforall", | |
"operands": "template proc scratch", | |
"results": "", | |
"description": "execute proc for each file name matching template" | |
}, | |
{ | |
"operator": "setfileposition", | |
"operands": "file int", | |
"results": "", | |
"description": "set file to specified position" | |
}, | |
{ | |
"operator": "fileposition", | |
"operands": "file", | |
"results": "int", | |
"description": "return current position in file" | |
}, | |
{ | |
"operator": "print", | |
"operands": "string", | |
"results": "", | |
"description": "write string to standard output file" | |
}, | |
{ | |
"operator": "=", | |
"operands": "any", | |
"results": "", | |
"description": "write text representation of any to standard output file" | |
}, | |
{ | |
"operator": "==", | |
"operands": "any", | |
"results": "", | |
"description": "write syntactic representation of any to standard output file" | |
}, | |
{ | |
"operator": "stack", | |
"operands": "any1 ... anyn", | |
"results": "any1 ... anyn", | |
"description": "print stack non-destructively using =" | |
}, | |
{ | |
"operator": "pstack", | |
"operands": "any1 ... anyn", | |
"results": "any1 ... anyn", | |
"description": "print stack non-destructively using ==" | |
}, | |
{ | |
"operator": "printobject", | |
"operands": "obj int", | |
"results": "", | |
"description": "write binary object to standard output file, using int as tag" | |
}, | |
{ | |
"operator": "writeobject", | |
"operands": "file obj int", | |
"results": "", | |
"description": "write binary object to file, using int as tag" | |
}, | |
{ | |
"operator": "setobjectformat", | |
"operands": "int", | |
"results": "", | |
"description": "set binary object format (0=disable, 1=IEEE high, 2=low, 3=native high, 4=low)" | |
}, | |
{ | |
"operator": "currentobjectformat", | |
"operands": "", | |
"results": "int", | |
"description": "return binary object format" | |
} | |
], | |
"Resource Operators": [ | |
{ | |
"operator": "defineresource", | |
"operands": "key instance category", | |
"results": "instance", | |
"description": "register named resource instance in category" | |
}, | |
{ | |
"operator": "undefineresource", | |
"operands": "key category", | |
"results": "", | |
"description": "remove resource registration" | |
}, | |
{ | |
"operator": "findresource", | |
"operands": "key category", | |
"results": "instance", | |
"description": "return resource instance identified by key in category" | |
}, | |
{ | |
"operator": "resourcestatus", | |
"operands": "key category", | |
"results": "status size true", | |
"description": "return status of resource instance or false" | |
}, | |
{ | |
"operator": "resourceforall", | |
"operands": "template proc scratch category", | |
"results": "", | |
"description": "enumerate resource instances in category" | |
} | |
], | |
"Virtual Memory Operators": [ | |
{ | |
"operator": "save", | |
"operands": "", | |
"results": "save", | |
"description": "create VM snapshot" | |
}, | |
{ | |
"operator": "restore", | |
"operands": "save", | |
"results": "", | |
"description": "restore VM snapshot" | |
}, | |
{ | |
"operator": "setglobal", | |
"operands": "bool", | |
"results": "", | |
"description": "set VM allocation mode (false = local, true = global)" | |
}, | |
{ | |
"operator": "currentglobal", | |
"operands": "", | |
"results": "bool", | |
"description": "return current VM allocation mode" | |
}, | |
{ | |
"operator": "gcheck", | |
"operands": "any", | |
"results": "bool", | |
"description": "true if any is simple or in global VM, false if in local VM" | |
}, | |
{ | |
"operator": "startjob", | |
"operands": "bool1 password", | |
"results": "bool2", | |
"description": "start new job that will alter initial VM if bool1 is true" | |
}, | |
{ | |
"operator": "defineuserobject", | |
"operands": "index any", | |
"results": "", | |
"description": "define user object associated with index" | |
}, | |
{ | |
"operator": "execuserobject", | |
"operands": "index", | |
"results": "", | |
"description": "execute user object associated with index<BR><PRE>userdict /UserObjects get<BR>exch get exec</PRE>" | |
}, | |
{ | |
"operator": "undefineuserobject", | |
"operands": "index", | |
"results": "", | |
"description": "remove user object associated with index<BR><PRE>userdict /UserObjects get<BR>exch null put</PRE>" | |
}, | |
{ | |
"operator": "UserObjects", | |
"operands": "", | |
"results": "array", | |
"description": "current UserObjects array defined in userdict" | |
} | |
], | |
"Miscellaneous Operators": [ | |
{ | |
"operator": "bind", | |
"operands": "proc", | |
"results": "proc", | |
"description": "replace operator names in proc by operators" | |
}, | |
{ | |
"operator": "null", | |
"operands": "", | |
"results": "null", | |
"description": "push null on operand stack" | |
}, | |
{ | |
"operator": "version", | |
"operands": "", | |
"results": "string", | |
"description": "interpreter version" | |
}, | |
{ | |
"operator": "realtime", | |
"operands": "", | |
"results": "int", | |
"description": "return real time in milliseconds" | |
}, | |
{ | |
"operator": "usertime", | |
"operands": "", | |
"results": "int", | |
"description": "return execution time in milliseconds" | |
}, | |
{ | |
"operator": "languagelevel", | |
"operands": "", | |
"results": "int", | |
"description": "level of language features" | |
}, | |
{ | |
"operator": "product", | |
"operands": "", | |
"results": "string", | |
"description": "product name" | |
}, | |
{ | |
"operator": "revision", | |
"operands": "", | |
"results": "int", | |
"description": "product revision level" | |
}, | |
{ | |
"operator": "serialnumber", | |
"operands": "", | |
"results": "int", | |
"description": "machine serial number" | |
}, | |
{ | |
"operator": "executive", | |
"operands": "", | |
"results": "", | |
"description": "invoke interactive executive" | |
}, | |
{ | |
"operator": "echo", | |
"operands": "bool", | |
"results": "", | |
"description": "turn on/off echoing" | |
}, | |
{ | |
"operator": "prompt", | |
"operands": "", | |
"results": "", | |
"description": "executed when ready for interactive input" | |
} | |
], | |
"Graphics State Operators—Device Independent": [ | |
{ | |
"operator": "gsave", | |
"operands": "", | |
"results": "", | |
"description": "push graphics state" | |
}, | |
{ | |
"operator": "grestore", | |
"operands": "", | |
"results": "", | |
"description": "pop graphics state" | |
}, | |
{ | |
"operator": "grestoreall", | |
"operands": "", | |
"results": "", | |
"description": "pop to bottommost graphics state" | |
}, | |
{ | |
"operator": "initgraphics", | |
"operands": "", | |
"results": "", | |
"description": "reset graphics state parameters" | |
}, | |
{ | |
"operator": "gstate", | |
"operands": "", | |
"results": "gstate", | |
"description": "create graphics state object" | |
}, | |
{ | |
"operator": "setgstate", | |
"operands": "gstate", | |
"results": "", | |
"description": "set graphics state from gstate" | |
}, | |
{ | |
"operator": "currentgstate", | |
"operands": "gstate", | |
"results": "gstate", | |
"description": "copy current graphics state into gstate" | |
}, | |
{ | |
"operator": "setlinewidth", | |
"operands": "num", | |
"results": "", | |
"description": "set line width" | |
}, | |
{ | |
"operator": "currentlinewidth", | |
"operands": "", | |
"results": "num", | |
"description": "return current line width" | |
}, | |
{ | |
"operator": "setlinecap", | |
"operands": "int", | |
"results": "", | |
"description": "set shape of line ends for stroke (0 = butt, 1 = round, 2 = square)" | |
}, | |
{ | |
"operator": "currentlinecap", | |
"operands": "", | |
"results": "int", | |
"description": "return current line cap" | |
}, | |
{ | |
"operator": "setlinejoin", | |
"operands": "int", | |
"results": "", | |
"description": "set shape of corners for stroke (0 = miter, 1 = round, 2 = bevel)" | |
}, | |
{ | |
"operator": "currentlinejoin", | |
"operands": "", | |
"results": "int", | |
"description": "return current line join" | |
}, | |
{ | |
"operator": "setmiterlimit", | |
"operands": "num", | |
"results": "", | |
"description": "set miter length limit" | |
}, | |
{ | |
"operator": "currentmiterlimit", | |
"operands": "", | |
"results": "num", | |
"description": "return current miter limit" | |
}, | |
{ | |
"operator": "setstrokeadjust", | |
"operands": "bool", | |
"results": "", | |
"description": "set stroke adjust (false = disable, true = enable)" | |
}, | |
{ | |
"operator": "currentstrokeadjust", | |
"operands": "", | |
"results": "bool", | |
"description": "return current stroke adjust" | |
}, | |
{ | |
"operator": "setdash", | |
"operands": "array offset", | |
"results": "", | |
"description": "set dash pattern for stroking<BR><PRE>[ ] 0 setdash % Turn dashing off: solid lines<BR>[3] 0 setdash % 3-unit on, 3-unit off, ...<BR>[2] 1 setdash % 1 on, 2 off, 2 on, 2 off, ...<BR>[2 1] 0 setdash % 2 on, 1 off, 2 on, 1 off, ...<BR>[3 5] 6 setdash % 2 off, 3 on, 5 off, 3 on, 5 off, ...<BR>[2 3] 11 setdash % 1 on, 3 off, 2 on, 3 off, 2 on, ...</PRE>" | |
}, | |
{ | |
"operator": "currentdash", | |
"operands": "", | |
"results": "array offset", | |
"description": "return current dash pattern" | |
}, | |
{ | |
"operator": "setcolorspace", | |
"operands": "array", | |
"results": "", | |
"description": "set color space" | |
}, | |
{ | |
"operator": "currentcolorspace", | |
"operands": "", | |
"results": "array", | |
"description": "return current color space" | |
}, | |
{ | |
"operator": "setcolor", | |
"operands": "comp1 ... compn", | |
"results": "", | |
"description": "set color components" | |
}, | |
{ | |
"operator": "currentcolor", | |
"operands": "", | |
"results": "comp1 ... compn", | |
"description": "return current color components" | |
}, | |
{ | |
"operator": "setgray", | |
"operands": "num", | |
"results": "", | |
"description": "set color space to DeviceGray and color to specified gray value (0 = black, 1 = white)" | |
}, | |
{ | |
"operator": "currentgray", | |
"operands": "", | |
"results": "num", | |
"description": "return current color as gray value" | |
}, | |
{ | |
"operator": "sethsbcolor", | |
"operands": "hue sat brt", | |
"results": "", | |
"description": "set color space to DeviceRGB and color to specified hue, saturation, brightness" | |
}, | |
{ | |
"operator": "currenthsbcolor", | |
"operands": "", | |
"results": "hue sat brt", | |
"description": "return current color as hue, saturation, brightness" | |
}, | |
{ | |
"operator": "setrgbcolor", | |
"operands": "red green blue", | |
"results": "", | |
"description": "set color space to DeviceRGB and color to specified red, green, blue" | |
}, | |
{ | |
"operator": "currentrgbcolor", | |
"operands": "", | |
"results": "red green blue", | |
"description": "return current color as red, green, blue" | |
}, | |
{ | |
"operator": "setcmykcolor", | |
"operands": "cyan magenta yellow black", | |
"results": "", | |
"description": "set color space to DeviceCMYK and color to specified cyan, magenta, yellow, black" | |
}, | |
{ | |
"operator": "currentcmykcolor", | |
"operands": "", | |
"results": "cyan magenta yellow black", | |
"description": "return current color as cyan, magenta, yellow, black" | |
} | |
], | |
"Graphics State Operators—Device Dependent": [ | |
{ | |
"operator": "sethalftone", | |
"operands": "dict", | |
"results": "", | |
"description": "set halftone dictionary" | |
}, | |
{ | |
"operator": "currenthalftone", | |
"operands": "", | |
"results": "dict", | |
"description": "return current halftone dictionary" | |
}, | |
{ | |
"operator": "setscreen", | |
"operands": "frequency angle proc", | |
"results": "", | |
"description": "set gray halftone screen" | |
}, | |
{ | |
"operator": "currentscreen", | |
"operands": "", | |
"results": "frequency angle proc", | |
"description": "return current gray halftone screen" | |
}, | |
{ | |
"operator": "setcolorscreen", | |
"operands": "redfreq redang redproc greenfreq greenang greenproc bluefreq blueang blueproc grayfreq grayang grayproc", | |
"results": "", | |
"description": "set all four halftone screens<BR><PRE>% 50 line dot screen with 75 degree cyan, 15 degree magenta<BR>% 0 degree yellow, and 45 degree black angled screens,<BR>% which are commonly used for color printing<BR>/sfreq 50 def % 50 halftone cells per inch<BR>/sproc {dup mul exch dup mul add 1 exch sub} def<BR> % Dot-screen spot function<BR>sfreq 75 /sproc load % 75 degree red (cyan) screen<BR>sfreq 15 /sproc load % 15 degree green (magenta) screen<BR>sfreq 0 /sproc load % 0 degree blue (yellow) screen<BR>sfreq 45 /sproc load % 45 degree gray (black) screen<BR>setcolorscreen</PRE>" | |
}, | |
{ | |
"operator": "currentcolorscreen", | |
"operands": "", | |
"results": "redfreq redang redproc greenfreq greenang greenproc bluefreq blueang blueproc grayfreq grayang grayproc", | |
"description": "return all four halftone screens" | |
}, | |
{ | |
"operator": "settransfer", | |
"operands": "proc", | |
"results": "", | |
"description": "set gray transfer function" | |
}, | |
{ | |
"operator": "currenttransfer", | |
"operands": "", | |
"results": "proc", | |
"description": "return current gray transfer function" | |
}, | |
{ | |
"operator": "setcolortransfer", | |
"operands": "redproc greenproc blueproc grayproc", | |
"results": "", | |
"description": "set all four transfer functions" | |
}, | |
{ | |
"operator": "currentcolortransfer", | |
"operands": "", | |
"results": "redproc greenproc blueproc grayproc", | |
"description": "return current transfer functions" | |
}, | |
{ | |
"operator": "setblackgeneration", | |
"operands": "proc", | |
"results": "", | |
"description": "set black generation function" | |
}, | |
{ | |
"operator": "currentblackgeneration", | |
"operands": "", | |
"results": "proc", | |
"description": "return current black generation function" | |
}, | |
{ | |
"operator": "setundercolorremoval", | |
"operands": "proc", | |
"results": "", | |
"description": "set undercolor removal function" | |
}, | |
{ | |
"operator": "currentundercolorremoval", | |
"operands": "", | |
"results": "proc", | |
"description": "return current undercolor removal function" | |
}, | |
{ | |
"operator": "setcolorrendering", | |
"operands": "dict", | |
"results": "", | |
"description": "set CIE based color rendering dictionary" | |
}, | |
{ | |
"operator": "currentcolorrendering", | |
"operands": "", | |
"results": "dict", | |
"description": "return current CIE based color rendering dictionary" | |
}, | |
{ | |
"operator": "setflat", | |
"operands": "num", | |
"results": "", | |
"description": "set flatness tolerance" | |
}, | |
{ | |
"operator": "currentflat", | |
"operands": "", | |
"results": "num", | |
"description": "return current flatness" | |
}, | |
{ | |
"operator": "setoverprint", | |
"operands": "bool", | |
"results": "", | |
"description": "set overprint parameter" | |
}, | |
{ | |
"operator": "currentoverprint", | |
"operands": "", | |
"results": "bool", | |
"description": "return current overprint parameter" | |
} | |
], | |
"Coordinate System and Matrix Operators": [ | |
{ | |
"operator": "matrix", | |
"operands": "", | |
"results": "matrix", | |
"description": "create identity matrix" | |
}, | |
{ | |
"operator": "initmatrix", | |
"operands": "", | |
"results": "", | |
"description": "set CTM to device default" | |
}, | |
{ | |
"operator": "identmatrix", | |
"operands": "matrix", | |
"results": "matrix", | |
"description": "fill matrix with identity transform" | |
}, | |
{ | |
"operator": "defaultmatrix", | |
"operands": "matrix", | |
"results": "matrix", | |
"description": "fill matrix with device default matrix" | |
}, | |
{ | |
"operator": "currentmatrix", | |
"operands": "matrix", | |
"results": "matrix", | |
"description": "fill matrix with CTM" | |
}, | |
{ | |
"operator": "setmatrix", | |
"operands": "matrix", | |
"results": "", | |
"description": "replace CTM by matrix" | |
}, | |
{ | |
"operator": "translate", | |
"operands": "tx ty", | |
"results": "", | |
"description": "translate user space by (tx, ty)" | |
}, | |
{ | |
"operator": "translate", | |
"operands": "tx ty matrix", | |
"results": "matrix", | |
"description": "define translation by (tx, ty)" | |
}, | |
{ | |
"operator": "scale", | |
"operands": "sx sy", | |
"results": "", | |
"description": "scale user space by sx and sy" | |
}, | |
{ | |
"operator": "scale", | |
"operands": "sx sy matrix", | |
"results": "matrix", | |
"description": "define scaling by sx and sy" | |
}, | |
{ | |
"operator": "rotate", | |
"operands": "angle", | |
"results": "", | |
"description": "rotate user space by angle degrees" | |
}, | |
{ | |
"operator": "rotate", | |
"operands": "angle matrix", | |
"results": "matrix", | |
"description": "define rotation by angle degrees" | |
}, | |
{ | |
"operator": "concat", | |
"operands": "matrix", | |
"results": "", | |
"description": "replace CTM by matrix × CTM<BR><PRE>matrix ⇒ [1.0 0.0 0.0 1.0 0.0 0.0]<BR>6 array identmatrix ⇒ [1.0 0.0 0.0 1.0 0.0 0.0]</PRE>" | |
}, | |
{ | |
"operator": "concatmatrix", | |
"operands": "matrix1 matrix2 matrix3", | |
"results": "matrix3", | |
"description": "fill matrix3 with matrix1 × matrix2" | |
}, | |
{ | |
"operator": "transform", | |
"operands": "x y", | |
"results": "x' y'", | |
"description": "transform (x, y) by CTM" | |
}, | |
{ | |
"operator": "transform", | |
"operands": "x y matrix", | |
"results": "x' y'", | |
"description": "transform (x, y) by matrix" | |
}, | |
{ | |
"operator": "dtransform", | |
"operands": "dx dy", | |
"results": "dx' dy'", | |
"description": "transform distance (dx, dy) by CTM" | |
}, | |
{ | |
"operator": "dtransform", | |
"operands": "dx dy matrix", | |
"results": "dx' dy'", | |
"description": "transform distance (dx, dy) by matrix" | |
}, | |
{ | |
"operator": "itransform", | |
"operands": "x' y'", | |
"results": "x y", | |
"description": "inverse transform (x', y') by CTM" | |
}, | |
{ | |
"operator": "itransform", | |
"operands": "x' y' matrix", | |
"results": "x y", | |
"description": "inverse transform (x', y') by matrix" | |
}, | |
{ | |
"operator": "idtransform", | |
"operands": "dx' dy'", | |
"results": "dx dy", | |
"description": "inverse transform distance (dx', dy') by CTM" | |
}, | |
{ | |
"operator": "idtransform", | |
"operands": "dx' dy' matrix", | |
"results": "dx dy", | |
"description": "inverse transform distance (dx', dy') by matrix" | |
}, | |
{ | |
"operator": "invertmatrix", | |
"operands": "matrix1 matrix2", | |
"results": "matrix2", | |
"description": "fill matrix2 with inverse of matrix1" | |
} | |
], | |
"Path Construction Operators": [ | |
{ | |
"operator": "newpath", | |
"operands": "", | |
"results": "", | |
"description": "initialize current path to be empty" | |
}, | |
{ | |
"operator": "currentpoint", | |
"operands": "", | |
"results": "x y", | |
"description": "return current point coordinate" | |
}, | |
{ | |
"operator": "moveto", | |
"operands": "x y", | |
"results": "", | |
"description": "set current point to (x, y)" | |
}, | |
{ | |
"operator": "rmoveto", | |
"operands": "dx dy", | |
"results": "", | |
"description": "relative moveto" | |
}, | |
{ | |
"operator": "lineto", | |
"operands": "x y", | |
"results": "", | |
"description": "append straight line to (x, y)" | |
}, | |
{ | |
"operator": "rlineto", | |
"operands": "dx dy", | |
"results": "", | |
"description": "relative lineto" | |
}, | |
{ | |
"operator": "arc", | |
"operands": "x y r ang1 ang2", | |
"results": "", | |
"description": "append counterclockwise arc" | |
}, | |
{ | |
"operator": "arcn", | |
"operands": "x y r ang1 ang2", | |
"results": "", | |
"description": "append clockwise arc" | |
}, | |
{ | |
"operator": "arct", | |
"operands": "x1 y1 x2 y2 r", | |
"results": "", | |
"description": "append tangent arc" | |
}, | |
{ | |
"operator": "arcto", | |
"operands": "x1 y1 x2 y2 r", | |
"results": "xt1 yt1 xt2 yt2", | |
"description": "append tangent arc" | |
}, | |
{ | |
"operator": "curveto", | |
"operands": "x1 y1 x2 y2 x3 y3", | |
"results": "", | |
"description": "append Bézier cubic section" | |
}, | |
{ | |
"operator": "rcurveto", | |
"operands": "dx1 dy1 dx2 dy2 dx3 dy3", | |
"results": "", | |
"description": "relative curveto" | |
}, | |
{ | |
"operator": "closepath", | |
"operands": "", | |
"results": "", | |
"description": "connect subpath back to its starting point" | |
}, | |
{ | |
"operator": "flattenpath", | |
"operands": "", | |
"results": "", | |
"description": "convert curves to sequences of straight lines" | |
}, | |
{ | |
"operator": "reversepath", | |
"operands": "", | |
"results": "", | |
"description": "reverse direction of current path" | |
}, | |
{ | |
"operator": "strokepath", | |
"operands": "", | |
"results": "", | |
"description": "compute outline of stroked path" | |
}, | |
{ | |
"operator": "ustrokepath", | |
"operands": "userpath", | |
"results": "", | |
"description": "compute outline of stroked userpath" | |
}, | |
{ | |
"operator": "ustrokepath", | |
"operands": "userpath matrix", | |
"results": "", | |
"description": "compute outline of stroked userpath" | |
}, | |
{ | |
"operator": "charpath", | |
"operands": "string bool", | |
"results": "", | |
"description": "append character outline to current path" | |
}, | |
{ | |
"operator": "uappend", | |
"operands": "userpath", | |
"results": "", | |
"description": "interpret userpath and append to current path<BR><PRE>systemdict begin % Ensure standard operator meanings<BR>cvx exec % Interpret userpath<BR>end</PRE>" | |
}, | |
{ | |
"operator": "clippath", | |
"operands": "", | |
"results": "", | |
"description": "set current path to clipping path" | |
}, | |
{ | |
"operator": "setbbox", | |
"operands": "llx lly urx ury", | |
"results": "", | |
"description": "set bounding box for current path" | |
}, | |
{ | |
"operator": "pathbbox", | |
"operands": "", | |
"results": "llx lly urx ury", | |
"description": "return bounding box of current path" | |
}, | |
{ | |
"operator": "pathforall", | |
"operands": "move line curve close", | |
"results": "", | |
"description": "enumerate current path" | |
}, | |
{ | |
"operator": "upath", | |
"operands": "bool", | |
"results": "userpath", | |
"description": "create userpath for current path; include ucache if bool is true" | |
}, | |
{ | |
"operator": "initclip", | |
"operands": "", | |
"results": "", | |
"description": "set clipping path to device default" | |
}, | |
{ | |
"operator": "clip", | |
"operands": "", | |
"results": "", | |
"description": "clip using non-zero winding number rule" | |
}, | |
{ | |
"operator": "eoclip", | |
"operands": "", | |
"results": "", | |
"description": "clip using even-odd inside rule" | |
}, | |
{ | |
"operator": "rectclip", | |
"operands": "x y width height", | |
"results": "", | |
"description": "clip with rectangular path" | |
}, | |
{ | |
"operator": "rectclip", | |
"operands": "numarray|numstring", | |
"results": "", | |
"description": "clip with rectangular paths" | |
}, | |
{ | |
"operator": "ucache", | |
"operands": "", | |
"results": "", | |
"description": "declare that user path is to be cached" | |
} | |
], | |
"Painting Operators": [ | |
{ | |
"operator": "erasepage", | |
"operands": "", | |
"results": "", | |
"description": "paint current page white" | |
}, | |
{ | |
"operator": "fill", | |
"operands": "", | |
"results": "", | |
"description": "fill current path with current color" | |
}, | |
{ | |
"operator": "eofill", | |
"operands": "", | |
"results": "", | |
"description": "fill using even-odd rule" | |
}, | |
{ | |
"operator": "stroke", | |
"operands": "", | |
"results": "", | |
"description": "draw line along current path" | |
}, | |
{ | |
"operator": "ufill", | |
"operands": "userpath", | |
"results": "", | |
"description": "interpret and fill userpath" | |
}, | |
{ | |
"operator": "ueofill", | |
"operands": "userpath", | |
"results": "", | |
"description": "fill userpath using even-odd rule" | |
}, | |
{ | |
"operator": "ustroke", | |
"operands": "userpath", | |
"results": "", | |
"description": "interpret and stroke userpath" | |
}, | |
{ | |
"operator": "ustroke", | |
"operands": "userpath matrix", | |
"results": "", | |
"description": "interpret userpath, concatenate matrix, and stroke" | |
}, | |
{ | |
"operator": "rectfill", | |
"operands": "x y width height", | |
"results": "", | |
"description": "fill rectangular path" | |
}, | |
{ | |
"operator": "rectfill", | |
"operands": "numarray|numstring", | |
"results": "", | |
"description": "fill rectangular paths" | |
}, | |
{ | |
"operator": "rectstroke", | |
"operands": "x y width height", | |
"results": "", | |
"description": "stroke rectangular path" | |
}, | |
{ | |
"operator": "rectstroke", | |
"operands": "numarray|numstring", | |
"results": "", | |
"description": "stroke rectangular paths" | |
}, | |
{ | |
"operator": "image", | |
"operands": "dict", | |
"results": "", | |
"description": "paint any sampled image" | |
}, | |
{ | |
"operator": "image", | |
"operands": "width height bits/samp matrix datasrc", | |
"results": "", | |
"description": "paint monochrome sampled image" | |
}, | |
{ | |
"operator": "colorimage", | |
"operands": "width height bits/comp matrix datasrc0 ... datasrcn−1 multi ncomp", | |
"results": "", | |
"description": "paint color sampled image" | |
}, | |
{ | |
"operator": "imagemask", | |
"operands": "dict", | |
"results": "", | |
"description": "paint current color through mask" | |
}, | |
{ | |
"operator": "imagemask", | |
"operands": "width height polarity matrix datasrc", | |
"results": "", | |
"description": "paint current color through mask<BR><PRE><BR>54 112 translate % Locate lower-left corner of square<BR>120 120 scale % Scale 1 unit to 120 points<BR>0 0 moveto 0 1 lineto % Fill square with gray background<BR>1 1 lineto 1 0 lineto closepath<BR>.9 setgray fill<BR>0 setgray % Paint mask black<BR>24 23 % Dimensions of source mask<BR>true % Paint the 1 bits<BR>[24 0 0 -23 0 23] % Map unit square to mask<BR>{<003B00 002700 002480 0E4940 114920<BR>14B220 3CB650 75FE88 17FF8C 175F14<BR>1C07E2 3803C4 703182 F8EDFC B2BBC2<BR>BB6F84 31BFC2 18EA3C 0E3E00 07FC00<BR>03F800 1E1800 1FF800>} % Mask data<BR>imagemask</PRE>" | |
} | |
], | |
"Insideness Testing Operators": [ | |
{ | |
"operator": "infill", | |
"operands": "x y", | |
"results": "bool", | |
"description": "test whether point (x, y) would be painted by fill" | |
}, | |
{ | |
"operator": "infill", | |
"operands": "userpath", | |
"results": "bool", | |
"description": "test whether pixels in userpath would be painted by fill" | |
}, | |
{ | |
"operator": "ineofill", | |
"operands": "x y", | |
"results": "bool", | |
"description": "test whether point (x, y) would be painted by eofill" | |
}, | |
{ | |
"operator": "ineofill", | |
"operands": "userpath", | |
"results": "bool", | |
"description": "test whether pixels in userpath would be painted by eofill" | |
}, | |
{ | |
"operator": "inufill", | |
"operands": "x y userpath", | |
"results": "bool", | |
"description": "test whether point (x, y) would be painted by ufill of userpath" | |
}, | |
{ | |
"operator": "inufill", | |
"operands": "userpath1 userpath2", | |
"results": "bool", | |
"description": "test whether pixels in userpath1 would be painted by inufill of userpath2" | |
}, | |
{ | |
"operator": "inueofill", | |
"operands": "x y userpath", | |
"results": "bool", | |
"description": "test whether point (x, y) would be painted by ueofill of userpath" | |
}, | |
{ | |
"operator": "inueofill", | |
"operands": "userpath1 userpath2", | |
"results": "bool", | |
"description": "test whether pixels in userpath1 would be painted by ueofill of userpath2" | |
}, | |
{ | |
"operator": "instroke", | |
"operands": "x y", | |
"results": "bool", | |
"description": "test whether point (x, y) would be painted by stroke" | |
}, | |
{ | |
"operator": "inustroke", | |
"operands": "x y userpath", | |
"results": "bool", | |
"description": "test whether point (x, y) would be painted by ustroke of userpath" | |
}, | |
{ | |
"operator": "inustroke", | |
"operands": "x y userpath matrix", | |
"results": "bool", | |
"description": "test whether point (x, y) would be painted by ustroke of userpath" | |
}, | |
{ | |
"operator": "inustroke", | |
"operands": "userpath1 userpath2", | |
"results": "bool", | |
"description": "test whether pixels in userpath1 would be painted by ustroke of userpath2" | |
}, | |
{ | |
"operator": "inustroke", | |
"operands": "userpath1 userpath2 matrix", | |
"results": "bool", | |
"description": "test whether pixels in userpath1 would be painted by ustroke of userpath2" | |
} | |
], | |
"Form and Pattern Operators": [ | |
{ | |
"operator": "makepattern", | |
"operands": "pattern matrix", | |
"results": "pattern'", | |
"description": "create pattern instance from prototype" | |
}, | |
{ | |
"operator": "setpattern", | |
"operands": "comp1 ... compn pattern", | |
"results": "", | |
"description": "install pattern as current color" | |
}, | |
{ | |
"operator": "execform", | |
"operands": "form", | |
"results": "", | |
"description": "paint form" | |
} | |
], | |
"Device Setup and Output Operators": [ | |
{ | |
"operator": "showpage", | |
"operands": "", | |
"results": "", | |
"description": "transmit and reset current page<BR><PRE>/#copies 5 def<BR>showpage</PRE>" | |
}, | |
{ | |
"operator": "copypage", | |
"operands": "", | |
"results": "", | |
"description": "transmit current page" | |
}, | |
{ | |
"operator": "setpagedevice", | |
"operands": "dict", | |
"results": "", | |
"description": "install page-oriented output device" | |
}, | |
{ | |
"operator": "currentpagedevice", | |
"operands": "", | |
"results": "dict", | |
"description": "return current page device parameters" | |
}, | |
{ | |
"operator": "nulldevice", | |
"operands": "", | |
"results": "", | |
"description": "install no-output device" | |
} | |
], | |
"Character and Font Operators": [ | |
{ | |
"operator": "definefont", | |
"operands": "key font", | |
"results": "font", | |
"description": "register font as a font dictionary" | |
}, | |
{ | |
"operator": "undefinefont", | |
"operands": "key", | |
"results": "", | |
"description": "remove font registration" | |
}, | |
{ | |
"operator": "findfont", | |
"operands": "key", | |
"results": "font", | |
"description": "return font dictionary identified by key" | |
}, | |
{ | |
"operator": "scalefont", | |
"operands": "font scale", | |
"results": "font'", | |
"description": "scale font by scale to produce new font<BR><PRE>/Helvetica findfont 12 scalefont setfont</PRE>" | |
}, | |
{ | |
"operator": "makefont", | |
"operands": "font matrix", | |
"results": "font'", | |
"description": "transform font by matrix to produce new font'<BR><PRE>/Helvetica findfont [10 0 0 12 0 0] makefont setfont</PRE>" | |
}, | |
{ | |
"operator": "setfont", | |
"operands": "font", | |
"results": "", | |
"description": "set font dictionary in graphics state<BR><PRE>/Helvetica findfont 10 scalefont setfont % Obtain prototype Helvetica font<BR>% Scale it to 10-unit size<BR>% Establish it as current font</PRE>" | |
}, | |
{ | |
"operator": "currentfont", | |
"operands": "", | |
"results": "font", | |
"description": "return current font dictionary" | |
}, | |
{ | |
"operator": "rootfont", | |
"operands": "", | |
"results": "font", | |
"description": "return root composite font dictionary" | |
}, | |
{ | |
"operator": "selectfont", | |
"operands": "key scale|matrix", | |
"results": "", | |
"description": "set font dictionary given name and transform<BR><PRE>/Helvetica 10 selectfont<BR>/Helvetica findfont 10 scalefont setfont</PRE>" | |
}, | |
{ | |
"operator": "show", | |
"operands": "string", | |
"results": "", | |
"description": "paint characters of string on page" | |
}, | |
{ | |
"operator": "ashow", | |
"operands": "ax ay string", | |
"results": "", | |
"description": "add (ax, ay) to width of each character while showing string" | |
}, | |
{ | |
"operator": "widthshow", | |
"operands": "cx cy char string", | |
"results": "", | |
"description": "add (cx, cy) to width of char while showing string<BR><PRE>/Helvetica findfont 12 scalefont setfont<BR>14 60 moveto (Normal spacing) show<BR>14 46 moveto 6 0 8#040 (Wide word spacing) widthshow</PRE>" | |
}, | |
{ | |
"operator": "awidthshow", | |
"operands": "cx cy char ax ay string", | |
"results": "", | |
"description": "combine effects of ashow and widthshow" | |
}, | |
{ | |
"operator": "xshow", | |
"operands": "string numarray|numstring", | |
"results": "", | |
"description": "paint characters of string using x widths in numarray|numstring" | |
}, | |
{ | |
"operator": "xyshow", | |
"operands": "string numarray|numstring", | |
"results": "", | |
"description": "paint characters of string using x and y widths in numarray|numstring" | |
}, | |
{ | |
"operator": "yshow", | |
"operands": "string numarray|numstring", | |
"results": "", | |
"description": "paint characters of string using y widths in numarray|numstring" | |
}, | |
{ | |
"operator": "glyphshow", | |
"operands": "name", | |
"results": "", | |
"description": "paint character identified by name" | |
}, | |
{ | |
"operator": "stringwidth", | |
"operands": "string", | |
"results": "wx wy", | |
"description": "width of string in current font" | |
}, | |
{ | |
"operator": "cshow", | |
"operands": "proc string", | |
"results": "", | |
"description": "invoke show mapping algorithm and call proc" | |
}, | |
{ | |
"operator": "kshow", | |
"operands": "proc string", | |
"results": "", | |
"description": "execute proc between characters shown from string" | |
}, | |
{ | |
"operator": "FontDirectory", | |
"operands": "", | |
"results": "dict", | |
"description": "dictionary of font dictionaries" | |
}, | |
{ | |
"operator": "GlobalFontDirectory", | |
"operands": "", | |
"results": "dict", | |
"description": "dictionary of font dictionaries in global VM" | |
}, | |
{ | |
"operator": "StandardEncoding", | |
"operands": "", | |
"results": "array", | |
"description": "Adobe standard font encoding vector" | |
}, | |
{ | |
"operator": "ISOLatin1Encoding", | |
"operands": "", | |
"results": "array", | |
"description": "international ISO Latin-1 font encoding vector" | |
}, | |
{ | |
"operator": "findencoding", | |
"operands": "key", | |
"results": "array", | |
"description": "find encoding array" | |
}, | |
{ | |
"operator": "setcachedevice", | |
"operands": "wx wy llx lly urx ury", | |
"results": "", | |
"description": "declare cached character metrics" | |
}, | |
{ | |
"operator": "setcachedevice2", | |
"operands": "w0x w0y llx lly urx ury w1x w1y vx vy", | |
"results": "", | |
"description": "declare cached character metrics" | |
}, | |
{ | |
"operator": "setcharwidth", | |
"operands": "wx wy", | |
"results": "", | |
"description": "declare uncached character metrics" | |
} | |
], | |
"Interpreter Parameter Operators": [ | |
{ | |
"operator": "setsystemparams", | |
"operands": "dict", | |
"results": "", | |
"description": "set system-wide interpreter parameters<BR><PRE><< /MaxFontCache 500000<BR>/MaxFontItem 7500<BR>/Password (xxxx)<BR>>> setsystemparams</PRE>" | |
}, | |
{ | |
"operator": "currentsystemparams", | |
"operands": "", | |
"results": "dict", | |
"description": "return system-wide interpreter parameters" | |
}, | |
{ | |
"operator": "setuserparams", | |
"operands": "dict", | |
"results": "", | |
"description": "set per-context interpreter parameters" | |
}, | |
{ | |
"operator": "currentuserparams", | |
"operands": "", | |
"results": "dict", | |
"description": "return per-context interpreter parameters" | |
}, | |
{ | |
"operator": "setdevparams", | |
"operands": "string dict", | |
"results": "", | |
"description": "set parameters for input/output device" | |
}, | |
{ | |
"operator": "currentdevparams", | |
"operands": "string", | |
"results": "dict", | |
"description": "return device parameters" | |
}, | |
{ | |
"operator": "vmreclaim", | |
"operands": "int", | |
"results": "", | |
"description": "control garbage collector" | |
}, | |
{ | |
"operator": "setvmthreshold", | |
"operands": "int", | |
"results": "", | |
"description": "control garbage collector" | |
}, | |
{ | |
"operator": "vmstatus", | |
"operands": "", | |
"results": "level used maximum", | |
"description": "report VM status" | |
}, | |
{ | |
"operator": "cachestatus", | |
"operands": "", | |
"results": "bsize bmax msize mmax csize cmax blimit", | |
"description": "return font cache status and parameters" | |
}, | |
{ | |
"operator": "setcachelimit", | |
"operands": "num", | |
"results": "", | |
"description": "set maximum bytes in cached character" | |
}, | |
{ | |
"operator": "setcacheparams", | |
"operands": "mark size lower upper", | |
"results": "", | |
"description": "change font cache parameters" | |
}, | |
{ | |
"operator": "currentcacheparams", | |
"operands": "", | |
"results": "mark size lower upper", | |
"description": "return current font cache parameters" | |
}, | |
{ | |
"operator": "setucacheparams", | |
"operands": "mark blimit", | |
"results": "", | |
"description": "set user path cache parameters" | |
}, | |
{ | |
"operator": "ucachestatus", | |
"operands": "", | |
"results": "mark bsize bmax rsize rmax blimit", | |
"description": "return user path cache status and parameters" | |
} | |
], | |
"Errors": [ | |
{ | |
"operator": "configurationerror", | |
"operands": "", | |
"results": "", | |
"description": "setpagedevice request cannot be satisfied" | |
}, | |
{ | |
"operator": "dictfull", | |
"operands": "", | |
"results": "", | |
"description": "no more room in dictionary" | |
}, | |
{ | |
"operator": "dictstackoverflow", | |
"operands": "", | |
"results": "", | |
"description": "too many begins" | |
}, | |
{ | |
"operator": "dictstackunderflow", | |
"operands": "", | |
"results": "", | |
"description": "too many ends" | |
}, | |
{ | |
"operator": "execstackoverflow", | |
"operands": "", | |
"results": "", | |
"description": "exec nesting too deep" | |
}, | |
{ | |
"operator": "handleerror", | |
"operands": "", | |
"results": "", | |
"description": "called to report error information" | |
}, | |
{ | |
"operator": "interrupt", | |
"operands": "", | |
"results": "", | |
"description": "external interrupt request (e.g., Control-C)" | |
}, | |
{ | |
"operator": "invalidaccess", | |
"operands": "", | |
"results": "", | |
"description": "attempt to violate access attribute" | |
}, | |
{ | |
"operator": "invalidcontext", | |
"operands": "", | |
"results": "", | |
"description": "improper use of context operation" | |
}, | |
{ | |
"operator": "invalidexit", | |
"operands": "", | |
"results": "", | |
"description": "exit not in loop" | |
}, | |
{ | |
"operator": "invalidfileaccess", | |
"operands": "", | |
"results": "", | |
"description": "unacceptable access string" | |
}, | |
{ | |
"operator": "invalidfont", | |
"operands": "", | |
"results": "", | |
"description": "invalid font name or dictionary" | |
}, | |
{ | |
"operator": "invalidid", | |
"operands": "", | |
"results": "", | |
"description": "invalid identifier for external object" | |
}, | |
{ | |
"operator": "invalidrestore", | |
"operands": "", | |
"results": "", | |
"description": "improper restore" | |
}, | |
{ | |
"operator": "ioerror", | |
"operands": "", | |
"results": "", | |
"description": "input/output error occurred" | |
}, | |
{ | |
"operator": "limitcheck", | |
"operands": "", | |
"results": "", | |
"description": "implementation limit exceeded" | |
}, | |
{ | |
"operator": "nocurrentpoint", | |
"operands": "", | |
"results": "", | |
"description": "current point is undefined" | |
}, | |
{ | |
"operator": "rangecheck", | |
"operands": "", | |
"results": "", | |
"description": "operand out of bounds" | |
}, | |
{ | |
"operator": "stackoverflow", | |
"operands": "", | |
"results": "", | |
"description": "operand stack overflow" | |
}, | |
{ | |
"operator": "stackunderflow", | |
"operands": "", | |
"results": "", | |
"description": "operand stack underflow" | |
}, | |
{ | |
"operator": "syntaxerror", | |
"operands": "", | |
"results": "", | |
"description": "PostScript language syntax error" | |
}, | |
{ | |
"operator": "timeout", | |
"operands": "", | |
"results": "", | |
"description": "time limit exceeded" | |
}, | |
{ | |
"operator": "typecheck", | |
"operands": "", | |
"results": "", | |
"description": "operand of wrong type" | |
}, | |
{ | |
"operator": "undefined", | |
"operands": "", | |
"results": "", | |
"description": "name not known" | |
}, | |
{ | |
"operator": "undefinedfilename", | |
"operands": "", | |
"results": "", | |
"description": "file not found" | |
}, | |
{ | |
"operator": "undefinedresult", | |
"operands": "", | |
"results": "", | |
"description": "over/underflow or meaningless result" | |
}, | |
{ | |
"operator": "undefinedresource", | |
"operands": "", | |
"results": "", | |
"description": "resource instance not found" | |
}, | |
{ | |
"operator": "unmatchedmark", | |
"operands": "", | |
"results": "", | |
"description": "expected mark not on stack" | |
}, | |
{ | |
"operator": "unregistered", | |
"operands": "", | |
"results": "", | |
"description": "internal error" | |
}, | |
{ | |
"operator": "VMerror", | |
"operands": "", | |
"results": "", | |
"description": "VM exhausted" | |
} | |
] | |
}; | |
function renderAllOperators(data) { | |
const operatorsTbody = document.getElementById("operators-tbody"); | |
operatorsTbody.innerHTML = ''; | |
for (const category in data) { | |
// Add category separator | |
const separatorRow = document.createElement("tr"); | |
const separatorCell = document.createElement("td"); | |
separatorCell.colSpan = 4; | |
separatorCell.className = "category-separator"; | |
separatorCell.textContent = category; | |
separatorRow.appendChild(separatorCell); | |
operatorsTbody.appendChild(separatorRow); | |
// Add operators for this category | |
data[category].forEach(op => { | |
const row = document.createElement("tr"); | |
row.className = "operator-row"; | |
row.dataset.category = category; | |
row.dataset.operator = op.operator; | |
const operandsCell = document.createElement("td"); | |
operandsCell.innerHTML = `<code>${op.operands}</code>`; | |
operandsCell.className = "operands-column"; | |
const operatorCell = document.createElement("td"); | |
operatorCell.innerHTML = `<code>${op.operator}</code>`; | |
operatorCell.className = "operator-column"; | |
const resultsCell = document.createElement("td"); | |
resultsCell.innerHTML = `<code>${op.results}</code>`; | |
resultsCell.className = "results-column"; | |
const descriptionCell = document.createElement("td"); | |
descriptionCell.innerHTML = op.description; | |
descriptionCell.className = "description-column"; | |
row.appendChild(operandsCell); | |
row.appendChild(operatorCell); | |
row.appendChild(resultsCell); | |
row.appendChild(descriptionCell); | |
operatorsTbody.appendChild(row); | |
}); | |
} | |
} | |
function searchOperators() { | |
const filter = document.getElementById("search-input").value.toUpperCase(); | |
const rows = document.querySelectorAll(".operator-row"); | |
const categories = {}; | |
// First determine which operators are visible | |
rows.forEach(row => { | |
const operator = row.dataset.operator; | |
const category = row.dataset.category; | |
const isVisible = operator.toUpperCase().includes(filter); | |
row.style.display = isVisible ? "" : "none"; | |
if (isVisible) { | |
categories[category] = true; | |
} | |
}); | |
// Then show/hide category headers | |
document.querySelectorAll(".category-separator").forEach(separator => { | |
const category = separator.textContent; | |
separator.parentElement.style.display = categories[category] ? "" : "none"; | |
}); | |
} | |
// Initialize the page | |
renderAllOperators(operatorsData); | |
document.getElementById("search-input").focus(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment