Postscript Operators 's'
save - save
save creates a snapshot of the current state of the virtual memory (VM)
and returns a save object representing that snapshot. Subsequently, this
save object may be presented to restore to reset the VM to this snapshot.
See the restore operator for a detailed description of what is saved in
the snapshot. save also saves the current graphics state by pushing a copy
of it on the graphics state stack in a manner similar to
gsave.
This saved graphics state is restored by
restore
and
grestoreall.
EXAMPLE:
/saveobj save def
...arbitrary computation...
saveobj restore % Restore saved VM state
ERRORS:
limitcheck,
stackoverflow
SEE ALSO:
restore,
gsave,
grestoreall,
vmstatus
Troubleshooting index
Back to Postscript index
scale sx sy scale sx sy matrix scale matrix
With no matrix operand, scale builds a temporary matrix and concatenates
this matrix with the current transformation matrix (CTM). Precisely, scale
replaces the CTM by S x CTM. The effect of this is to make the x and y units
in the user coordinate system the size of sx and sy units in the former
user coordinate system. The position of the user coordinate origin and the
orientation of the axes are unchanged. If the matrix operand is supplied,
scale replaces the value of matrix by S and pushes the modified matrix back
on the operand stack In this case, scale does not affect the CTM.
ERRORS:
rangecheck,
stackunderflow,
typecheck
SEE ALSO:
rotate,
translate,
concat
Troubleshooting index
Back to Postscript index
scalefont font scale scalefont font'
applies the scale factor scale to font, producing a new font' whose characters
are scaled by scale (in both x and y) when they are shown. scalefont first
creates a copy of font, then replaces the new font's FontMatrix entry with
the result of scaling the existing FontMatrix by scale.
It inserts two additional entries, OrigFont and ScaleMatrix, whose purpose
is internal to the implementation. Finally, it returns the result as font'.
Showing characters from the transformed font produces the same results as
showing from the original font after having scaled user space by the factor
scale in both x and y by means of the
scale operator.
scalefont is essentially a convenience operator that enables the desired
scale factor to be encapsulated in the font description. Another operator,
makefont, performs more general transformations than simple scaling. See
the description of makefont for more information on how the transformed
font is derived. selectfont combines the effects of findfont and scalefont.
The interpreter keeps track of font dictionaries recently created by scalefont.
Calling scalefont multiple times with the same font and scale will usually
return the same font' rather than create a new one each time. However, it
is usually more efficient for a PostScript language program to apply scalefont
only once for each font that it needs and to keep track of the resulting
font dictionaries on its own."
The
makefont, scalefont, and
selectfont
operators produce a font dictionary derived from an original font dictionary,
but with the FontMatrix entry altered. The derived font dictionary is allocated
in local or global VM according to whether the original font dictionary
is in local or global VM. This is independent of the current VM allocation
mode.
EXAMPLE:
/Helvetica findfont 12 scalefont setfont
This obtains the standard Helvetica font, which is defined with a 1-unit
line height, and scales it by a factor of 12 in both x and y dimensions.
This produces a 12-unit high font (i.e., a 12-point font in default user
space) whose characters have the same proportions as those in the original
font.
ERRORS:
invalidfont,
stackunderflow,
typecheck,
undefined
SEE ALSO:
makefont,
setfont,
findfont,
selectfont
scheck any scheck bool LEVEL 2
has the same semantics as gcheck. This operator is defined for compatibility
with existing Display PostScript applications.
ERRORS:
stackunderflow
SEE ALSO:
gcheck
Troubleshooting index
Back to Postscript index
search string seek search post match pre true (if found)
string false (if not found)
looks for the first occurrence of the string seek within string and returns
results of this search on the operand stack. The topmost result is a boolean
that indicates if the search succeeded. If search finds a subsequence of
string whose elements are equal to the elements of seek, it splits string
into three segments: pre, the portion of string preceding the match; match,
the portion of string that matches seek; and post, the remainder of string.
It then pushes the string objects post, match, and pre on the operand stack,
followed by the boolean true. All three of these strings are substrings
sharing intervals of the value of the original string. If search does not
find a match, it pushes the original string and the boolean false.
EXAMPLE:
(abbc) (ab) search -> (bc) (ab) ( ) true
(abbc) (bb) search -> (c) (bb) (a) true
(abbc) (bc) search -> ( ) (bc) (ab) true
(abbc) (B) search -> (abbc) false
ERRORS:
invalidaccess,
stackoverflow,
stackunderflow,
typecheck
SEE ALSO:
anchorsearch,
token
Troubleshooting index
Back to Postscript index
selectfont key scale selectfont - key matrix selectfont - LEVEL 2
obtains a font whose name is key, transforms it according to scale or matrix,
and establishes it as the current font dictionary in the graphics state.
selectfont is equivalent to one of the following, according to whether the
second operand is a number or a matrix:
key
findfont
scale
scalefont
setfont key
findfont
matrix
makefont
setfont
If the font named by key is already defined in VM, selectfont obtains the
font dictionary directly and does not execute findfont. However, if the
font is not defined, selectfont invokes findfont in the normal way. In the
latter case, it actually executes the name object
findfont,
so it uses the current definition of that name in the environment of the
dictionary stack.
On the other hand, redefining
exch,
scalefont,
makefont, or
setfont
would not alter the behavior of selectfont. selectfont can give rise to
any of the errors possible for the component operations, including arbitrary
errors from a user-defined
findfont procedure.
EXAMPLE:
/Helvetica 10 selectfont /Helvetica findfont 10 scalefont setfont
The two lines of the example have the same effect, but the first one is
almost always more efficient. The makefont, scalefont, and selectfont operators
produce a font dictionary derived from an original font dictionary, but
with the FontMatrix entry altered.
The derived font dictionary is allocated in local or global VM according
to whether the original font dictionary is in local or global VM. This is
independent of the current VM allocation mode.
ERRORS:
invalidfont,
rangecheck,
stackunderflow,
typecheck
SEE ALSO:
findfont,
makefont,
scalefont,
setfont
Troubleshooting index
Back to Postscript index
serialnumber - serialnumber int LEVEL 2
returns an integer that purports to represent the specific machine on which
the PostScript interpreter is running. The precise significance of this
number (including any claim of its uniqueness) is product dependent.
ERRORS:
stackoverflow
SEE ALSO:
languagelevel,
product,
revision,
version
Troubleshooting index
Back to Postscript index
setbbox llx lly urx ury setbbox
- establishes a bounding box for the current path, within which the coordinates
of all subsequent path construction operators must fall.
The bounding box is defined by two pairs of coordinates in user space:
llx and lly specify the lower-left corner,
urx and ury the upper-right corner.
It is a rectangle oriented with the user space coordinate system axes. The
bounding box remains in effect for the lifetime of the current path-that
is, until the next newpath or operator that resets the path implicitly.
Any attempt to append a path element with a coordinate lying outside the
bounding box will give rise to a rangecheck error.
Note that arcs are converted to sequences of curveto operations. The coordinates
computed as control points for those curvetos must also fall within the
bounding box. This means that the figure of the arc must be entirely enclosed
by the bounding box. On the other hand, the bounds checking applies only
to the path itself, not to the result of rendering the path.
For example, stroking the path may place marks outside the bounding box.
This does not cause an error. Although the setbbox operator can be used
when defining any path, its main use is in defining a user path, where it
is mandatory. That is, a user path procedure passed to one of the user path
rendering operators, such as
ufill, must
begin with a setbbox optionally preceded by a
ucache.
The bounding box information passed to setbbox enables the user path rendering
operator to optimize execution.
If setbbox appears more than once during definition of a path, the path's
effective bounding box is successively enlarged to enclose the union of
all specified bounding boxes. This is not legal in a user path definition.
However, this case might arise if uappend is executed multiple times in
building up a single current path by concatenating several user paths.
If setbbox has established a bounding box, execution of pathbbox returns
a result derived from that bounding box instead of one derived from the
actual path. The upper-right coordinate values must be greater than or equal
to the lower-left values. Otherwise, a
rangecheck
error will occur.
ERRORS:
rangecheck,
stackunderflow,
typecheck
SEE ALSO:
pathbbox
Troubleshooting index
Back to Postscript index
setblackgeneration proc setblackgeneration - LEVEL 2
sets the black generation function parameter in the graphics state. The
proc operand must be a procedure that can be called with a number in the
range 0.0 to 1.0 (inclusive) on the operand stack and that returns a number
in the same range. This procedure computes the value of the black component
during conversion from DeviceRGB color space to DeviceCMYK.
setblackgeneration sets a graphics state parameter whose effect is device
dependent. It should not be used in a page description that is intended
to be device independent.
Execution of this operator is not permitted in certain circumstances.
ERRORS:
stackunderflow,
typecheck,
undefined
SEE ALSO:
setundercolorremoval
Troubleshooting index
Back to Postscript index
setcachedevice wx wy llx lly urx ury setcachedevice
- passes width and bounding box information to the PostScript interpreter's
font machinery. setcachedevice may be executed only within the context of
the BuildGlyph or BuildChar procedure for a type 3 font.
BuildGlyph or BuildChar must invoke setcachedevice,
setcachedevice2,
or
setcharwidth before executing graphics operators
to define and paint the character. setcachedevice requests the font machinery
to transfer the results of those operators both into the font cache, if
possible, and onto the current page. The operands to setcachedevice are
all numbers interpreted in the character coordinate system .
wx and wy comprise the basic width vector for this character-in other words,
the normal position of the origin of the next character relative to origin
of this one. llx and lly are the coordinates of the lower-left corner and
urx and ury are the coordinates of the upper-right corner of the character
bounding box. The character bounding box is the smallest rectangle, oriented
with the character coordinate system axes, that completely encloses all
marks placed on the page as a result of executing the character's description.
For a character defined as a path, this may be determined by means of the
pathbbox operator. The font machinery needs this information to make decisions
about clipping and caching. The declared bounding box must be correct-in
other words, sufficiently large to enclose the entire character. If any
marks fall outside this bounding box, they will be clipped off and not moved
to the current page. setcachedevice installs identical sets of metrics for
writing modes 0 and 1, while
setcachedevice2
installs separate metrics.
After execution of setcachedevice and until the termination of the BuildGlyph
or BuildChar procedure, execution of color setting operators or image is
not allowed. Note that use of the
imagemask
operator is permitted.
ERRORS:
stackunderflow,
typecheck,
undefined
SEE ALSO:
setcachedevice2,
setcharwidth,
setcachelimit,
cachestatus
Troubleshooting index
Back to Postscript index
setcachedevice2 w0x w0y llx lly urx ury w1x w1y vx vy setcachedevice2
- LEVEL 2
passes two sets of character metrics to the font machinery.
w0x and w0y are the distances from the current point
to the new current point when showing text in writing mode 0.
llx,lly and urx,ury are the distances from origin 0
to the lower-left and upper-right corners of the character bounding box.
w1x, w1y are the distances from the current point to the new current point
when showing text in writing mode 1.
vx and vy are the distances from origin 0 to origin 1.
Aside from its interpretation of the operands, setcachedevice2 works the
same as
setcachedevice in all respects. After
execution of setcachedevice2 and until the termination of the BuildGlyph
or BuildChar procedure, execution of color setting operators or image is
not allowed. Note that use of the
imagemask
operator is permitted.
ERRORS:
stackunderflow,
typecheck,
undefined
SEE ALSO:
setcachedevice,
setcharwidth,
setcachelimit,
cachestatus
Troubleshooting index
Back to Postscript index
setcachelimit int setcachelimit
- establishes the maximum number of bytes the pixel array of a single cached
character may occupy. Any character larger than this (according to the character
bounding box information passed to setcachedevice) is not saved in the font
cache. Instead, its description is executed every time the character is
encountered. setcachelimit affects the decision whether to place new characters
in the font cache; it does not disturb any characters already in the cache.
Making the limit larger allows larger characters to be cached, but may decrease
the total number of different characters that can be held in the cache simultaneously.
Changing this parameter is appropriate only in very unusual situations.
The maximum limit for int is implementation dependent, representing the
total available size of the font cache (see cachestatus). As a practical
matter, int should not be larger than a small fraction of the total font
cache size. Modifications to the cache limit parameter obey save and restore.
In a Display PostScript system, which supports multiple contexts, this parameter
is maintained separately for each context. The parameter set by setcachelimit
is the same as the MaxFontItem user parameter set by
setuserparams.
ERRORS:
limitcheck,
rangecheck,
stackunderflow,
typecheck
SEE ALSO:
cachestatus,
setuserparams
Troubleshooting index
Back to Postscript index
setcacheparams mark size lower upper setcacheparams - LEVEL 2
sets cache parameters as specified by the integer objects above the topmost
mark on the stack, then removes all operands and the mark object as if by
cleartomark. The number of cache parameters is variable.
In future versions of the PostScript interpreter, there may be more than
three cache parameters defined. If more operands are supplied to setcacheparams
than are needed, the topmost ones are used and the remainder ignored. If
fewer are supplied than are needed, setcacheparams implicitly inserts default
values between the mark and the first supplied operand.
The upper operand specifies the maximum number of bytes the pixel array
of a single cached character may occupy, as determined from the information
presented by the
setcachedevice operator.
This is the same parameter set by
setcachelimit.
The lower operand specifies the threshold at which characters may be stored
in compressed form rather than as full pixel arrays. If a character's pixel
array requires more than lower bytes to represent, it may be compressed
in the cache and reconstituted from the compressed representation each time
it is needed. Some devices do not support compression of characters. Setting
lower to zero forces all characters to be compressed, permitting more characters
to be stored in the cache, but increasing the work required to print them.
Setting lower to a value greater than or equal to upper disables compression
altogether.
The size operand specifies the new size of the font cache in bytes (the
bmax value returned by cachestatus). If size is not specified, the font
cache size is unchanged. If size lies outside the range of font cache sizes
permitted by the implementation, the nearest permissible size is substituted
with no error indication.
Reducing the font cache size can cause some existing cached characters to
be discarded, increasing execution time when those characters are next shown.
The parameters set by setcacheparams are the same as the MaxFontCache system
parameter and the MinFontCompress and MaxFontItem user parameters, set by
setsystemparams and
setuserparams,
respectively .
ERRORS:
rangecheck,
typecheck,
unmatchedmark
SEE ALSO:
currentcacheparams,
setcachelimit,
setsystemparams,
setuserparams
Troubleshooting index
Back to Postscript index
setcharwidth wx wy setcharwidth
- is similar to setcachedevice, but it passes only width information to
the PostScript interpreter's font machinery and it declares that the character
being defined is not to be placed in the font cache. setcharwidth is useful,
for example, in defining characters that incorporate two or more specific
opaque colors, such as opaque black and opaque white.
This is unusual. Most characters have no inherent color, but are painted
with the current color within the character's outline, leaving the area
outside unpainted (transparent). Another use of setcharwidth is in defining
characters that intentionally change their behavior based on the environment
in which they execute. Such characters must not be cached, because that
would subvert the intended variable behavior.
ERRORS:
stackunderflow,
typecheck,
undefined
SEE ALSO:
setcachedevice,
setcachedevice2
Troubleshooting index
Back to Postscript index
setcmykcolor cyan magenta yellow black setcmykcolor - LEVEL 2
sets the color space to DeviceCMYK, then sets the current color parameter
in the graphics state to a color described by the parameters cyan, magenta,
yellow, and black, each of which must be a number in the range 0.0 to 1.0.
This establishes the color subsequently used to paint shapes, such as lines,
areas, and characters on the current page. Color values set by setcmykcolor
are not affected by the black generation and undercolor removal operations.
setcmykcolor does not give an error for a value outside the range 0 to 1.
It substitutes the nearest legal value.
Execution of this operator is not permitted in certain circumstances.
ERRORS:
stackunderflow,
typecheck,
undefined
SEE ALSO:
setcolorspace,
setcolor,
currentcmykcolor
Troubleshooting index
Back to Postscript index
setcolor comp1 comp2 ... compn setcolor - LEVEL 2
sets the current color parameter in the graphics state to that described
by the color components comp1, comp2 ..., compn in the current color space.
The number of color components and the valid range of color component values
depends on the current color space. If the wrong number of components is
specified, an error will occur, such as
stackunderflow
or
typecheck. If a component value is
outside the valid range, the nearest valid value will be substituted without
error indication. The initial value of the color parameter varies by color
space. It is initialized by the
setcolorspace
operator.
Execution of this operator is not permitted in certain circumstances.
ERRORS:
stackunderflow,
typecheck,
undefined
SEE ALSO:
currentcolor,
setcolorspace
Troubleshooting index
Back to Postscript index
setcolorrendering dict setcolorrendering - LEVEL 2
establishes dict as the current CIE based color rendering dictionary in
the graphics state. The default color rendering dictionary is device dependent
). setcolorrendering sets a graphics state parameter whose effect is device
dependent. It should not be used in a page description that is intended
to be device independent.
Execution of this operator is not permitted in certain circumstances.
ERRORS:
stackunderflow,
typecheck
limitcheck,
rangecheck,
undefined
SEE ALSO:
currentcolorrendering
Troubleshooting index
Back to Postscript index
setcolorscreen
redfreq redang redproc
greenfreq greenang greenproc
bluefreq blueang blueproc
grayfreq grayang grayproc setcolorscreen - LEVEL 2
sets the halftone parameter in the graphics state. setcolorscreen specifies
halftone screen definitions for all four primary color components of the
output device: red, green, blue, and gray or their complements: cyan, magenta,
yellow, and black. For each component, setcolorscreen expects frequency,
angle, and spot function operands, which it interprets the same as setscreen
. setcolorscreen sets a graphics state parameter whose effect is device
dependent. It should not be used in a page description that is intended
to be device independent.
EXAMPLE:
% 50 line dot screen with 75 degree cyan, 15 degree magenta
% 0 degree yellow, and 45 degree black angled screens,
% which are commonly used for color printing
/sfreq 50 def % 50 halftone cells per inch
/sproc /{
dup mul exch dup mul add 1 exch sub} def % Dot-screen spot function
sfreq 75 /sproc load % 75 degree red (cyan) screen
sfreq 15 /sproc load % 15 degree green (magenta) screen
sfreq 0 /sproc load % 0 degree blue (yellow) screen
sfreq 45 /sproc load % 45 degree gray (black) screen setcolorscreen
Execution of this operator is not permitted in certain circumstances.
ERRORS:
limitcheck,
rangecheck,
stackunderflow,
typecheck
SEE ALSO:
currentcolorscreen,
setscreen,
sethalftone
Troubleshooting index
Back to Postscript index
setcolorspace array setcolorspace
name setcolorspace - LEVEL 2
- The first form sets the color space parameter in the graphics state to
that described by the specified array.
The array must be in the form [ key param1 ... paramn] where key is a name
that identifies the color space family and the parameters param1 ... paramn
further describe the space as a whole.
The second form specifies a color space by giving just its name. This is
allowed only for those color spaces that require no parameters, namely DeviceGray,
DeviceRGB, DeviceCMYK, and Pattern. Specifying a color space by name is
equivalent to specifying it by an array containing just that name. The setcolorspace
operator also sets the current color parameter in the graphics state to
its initial value, which depends on the color space.
Execution of this operator is not permitted in certain circumstances. The
details of the color space parameters, the definitions of the components
of a specific color in the space, and initial values of those components
vary from one color space to another. The initial value of the color space
parameter is /DeviceGray.
ERRORS:
stackunderflow,
typecheck
,
rangecheck,
undefined
SEE ALSO:
currentcolorspace,
setcolor
Troubleshooting index
Back to Postscript index
setcolortransfer redproc greenproc blueproc grayproc setcolortransfer
- LEVEL 2
sets the transfer function parameter in the graphics state. setcolortransfer
specifies transfer functions for all four primary color components of the
output device: red, green, blue, and gray or their complements: cyan, magenta,
yellow, and black.
Each operand must be a PostScript language procedure that may be called
with a number in the range 0.0 to 1.0 (inclusive) on the operand stack and
that will return a number in the same range. These procedures adjust the
values of device color components.
Only those transfer functions corresponding to color components supported
by a device will have an effect on that device's output. For example, redproc,
greenproc, and blueproc will have no effect on a black-and-white device,
while grayproc will have no effect on an RGB device.
setcolortransfer sets a graphics state parameter whose effect is device
dependent. It should not be used in a page description that is intended
to be device independent.
Execution of this operator is not permitted in certain circumstances.
ERRORS:
stackunderflow,
typecheck,
undefined
SEE ALSO:
currentcolortransfer,
settransfer
Troubleshooting index
Back to Postscript index
setdash array offset setdash
- sets the dash pattern parameter in the graphics state, controlling the
dash pattern used during subsequent executions of the stroke operator and
operators based on stroke, such as rectstroke and ustroke.
If array is empty (i.e., its length is zero), stroke produces a normal,
unbroken line.
If array is not empty, stroke produces dashed lines whose pattern is given
by the elements of array, all of which must be non-negative numbers and
not all zero. stroke interprets the elements of array in sequence as distances
along the path, measured in user space.
These distances alternately specify the length of a dash and the length
of a gap between dashes. stroke uses the contents of array cyclically. When
it reaches the end of the array, it starts again at the beginning. Dashed
lines wrap around curves and corners just as normal strokes do.
The ends of each dash are treated with the
current
line cap; corners within a dash are treated with the
current
line join. stroke does not take any measures to coordinate the dash
pattern with features of the path. It simply dispenses dashes along the
path as specified by array.
The offset operand may be thought of as the "phase" of the dash
pattern relative to the start of the path. It is interpreted as a distance
into the dash pattern (measured in user space) at which the pattern should
be started.
Before beginning to stroke a path, stroke cycles through the elements of
array, adding up distances and alternating dashes and gaps as usual, but
without generating any output. When it has travelled the offset distance
into the dash pattern, it starts stroking the path from its beginning, using
the dash pattern from the point that has been reached. Each subpath of a
path is treated independently-in other words, the dash pattern is restarted
and offset applied to it at the beginning of each subpath.
EXAMPLE:
[ ] 0 setdash % Turn dashing off: solid lines
[3] 0 setdash % 3-unit on, 3-unit off,
... [2] 1 setdash % 1 on, 2 off, 2 on, 2 off,
... [2 1] 0 setdash % 2 on, 1 off, 2 on, 1 off,
... [3 5] 6 setdash % 2 off, 3 on, 5 off, 3 on, 5 off,
... [2 3] 11 setdash % 1 on, 3 off, 2 on, 3 off, 2 on, ...
ERRORS:
limitcheck,
stackunderflow,
typecheck
SEE ALSO:
currentdash,
stroke
Troubleshooting index
Back to Postscript index
setdevparams string dict setdevparams - LEVEL 2
attempts to set one or more parameters for the device identified by string
according to keys and new values contained in the dict operand. The string
identifies a storage or I/O device
. The dictionary is a container for key-value pairs; setdevparams reads
the information from the dictionary but does not retain the dictionary itself.
Device parameters whose keys are not mentioned in dict are left unchanged.
Each parameter is identified by a key, which is always a name object. The
value is usually (but not necessarily) an integer. The names of I/O devices
and the names and semantics of their parameters are product-dependent. They
are not documented in this manual, but rather in product-specific documentation.
Permission to alter device parameters is controlled by a password. The dictionary
must contain an entry named Password whose value is the system parameter
password (a string or integer). If the password is incorrect, setdevparams
executes an
invalidaccess error
and does not alter any parameters. Some device parameters can be set permanently
in non-volatile storage that survives restarts of the PostScript interpreter.
This capability is implementation dependent.
No error occurs if parameters cannot be stored permanently. Various errors
are possible. Details of error behavior are product dependent, but the following
behavior is typical:
- If a parameter name is not known to the implementation, an
undefined
error occurs.
- If a parameter value is of the wrong type, a
typecheck
error occurs.
- If a parameter value is unreasonable-for instance, a negative integer
for a parameter that must be positive-a
rangecheck
error occurs.
- If a parameter value is reasonable but cannot be achieved by the implementation,
either the nearest achievable value is substituted or a
configurationerror
occurs, depending on the device and the parameter.
ERRORS:
configurationerror,
invalidaccess,
rangecheck,
stackunderflow,
typecheck,
undefined
SEE ALSO:
currentdevparams,
setsystemparams,
setuserparams
Troubleshooting index
Back to Postscript index
setfileposition file position setfileposition - LEVEL 2
repositions an existing open file to a new position so the next read or
write operation will commence at that position. The position operand is
a non-negative integer interpreted as number of bytes from the beginning
of the file. For an output file, setfileposition first performs an implicit
flushfile . The result of positioning
beyond end-of-file for both reading and writing depends on the behavior
of the underlying file system. Typically, positioning beyond the existing
end-of-file will lengthen the file if it is open for writing and the file's
access permits. The storage appended to the file has unspecified contents.
If lengthening the file is not permitted, an
ioerror
occurs. Possible causes of an ioerror are: the file object is not valid,
the underlying file is not positionable, the specified position is invalid
for the file, or a device-dependent error condition is detected.
ERRORS:
ioerror,
rangecheck,
stackunderflow,
typecheck
,
undefinedfilename
SEE ALSO:
fileposition,
file
Troubleshooting index
Back to Postscript index
setflat num setflat
- sets the flatness parameter in the graphics state to num, which must be
a positive number. This controls the accuracy with which curved path segments
are to be rendered on the raster output device by operators such as stroke,
fill, and clip. Those operators render curves by approximating them with
a series of straight line segments. "Flatness" is an informal
term for the error tolerance of this approximation; it is the maximum distance
of any point of the approximation from the corresponding point on the true
curve, measured in output device pixels.
If the flatness parameter is large enough to cause visible straight line
segments to appear, the result is unpredictable. The purpose of setflat
is to control the accuracy of curve rendering, not to draw inscribed polygons.
The choice of flatness value is a trade-off between accuracy and execution
efficiency. Very small values (less than 1 device pixel) produce very accurate
curves at high cost, because enormous numbers of tiny line segments must
be produced. Larger values produce cruder approximations with substantially
less computation. A default value of the flatness parameter is established
by the device setup routine for each raster output device. This value is
based on characteristics of that device and is the one suitable for most
applications.
The acceptable range of values for num is 0.2 to 100. Values outside this
range are forced into range without error indication. setflat sets a graphics
state parameter whose effect is device dependent. It should not be used
in a page description that is intended to be device independent.
ERRORS:
stackunderflow,
typecheck
SEE ALSO:
currentflat,
flattenpath,
stroke,
fill
Troubleshooting index
Back to Postscript index
setfont font setfont
- establishes the font dictionary parameter in the graphics state. This
specifies the font to be used by subsequent character operators, such as
show and
stringwidth. font
must be a valid font dictionary previously returned by
findfont,
scalefont, or
makefont.
EXAMPLE:
/Helvetica findfont % Obtain prototype
Helvetica font 10 scalefont % Scale it to 10-unit size
setfont % Establish it as current font
ERRORS:
invalidfont,
stackunderflow,
typecheck
SEE ALSO:
currentfont,
scalefont,
makefont,
findfont,
selectfont
Troubleshooting index
Back to Postscript index
setglobal bool setglobal - LEVEL 2
sets the VM allocation mode: true denotes global, false denotes local. This
controls the VM region in which the values of new composite objects are
to be allocated. It applies to objects created implicitly by the scanner
and to those created explicitly by PostScript operators. Modifications to
the VM allocation mode are subject to
save and
restore.
In a Display PostScript system, which supports multiple execution contexts,
the VM allocation mode is maintained separately for each context. The standard
error handlers in
errordict execute false
setglobal, reverting to local VM allocation mode if an error occurs.
ERRORS:
stackunderflow,
typecheck
SEE ALSO:
currentglobal
Troubleshooting index
Back to Postscript index
setgray num setgray
- sets the color space to DeviceGray, then sets the current color parameter
in the graphics state to a gray shade corresponding to num. This must be
a number between 0 and 1, with 0 corresponding to black, 1 corresponding
to white, and intermediate values corresponding to intermediate shades of
gray. setgray establishes the color subsequently used to paint shapes, such
as lines, areas, and characters, on the current page. setgray does not give
a rangecheck error for a value outside the range 0 to 1; it substitutes
the nearest legal value.
Execution of this operator is not permitted in certain circumstances
ERRORS:
stackunderflow,
typecheck,
undefined
SEE ALSO:
currentgray,
setcolorspace,
setcolor
Troubleshooting index
Back to Postscript index
setgstate gstate setgstate - LEVEL 2
replaces the current graphics state by the value of the gstate object. This
is a copying operation, so subsequent modifications to the value of gstate
will not affect the current graphics state or vice versa. Note that this
is a wholesale replacement of all components of the graphics state; in particular,
the current clipping path is replaced by the value in
gstate,
not intersected with it.
ERRORS:
invalidaccess,
stackunderflow,
typecheck
SEE ALSO:
gstate,
currentgstate,
gsave,
grestore
Troubleshooting index
Back to Postscript index
sethalftone halftone sethalftone - LEVEL 2
establishes halftone as the halftone parameter in the graphics state. Once
established, the halftone dictionary should be treated as readonly. If the
halftone dictionary's HalftoneType value is out of bounds or is not supported
by the PostScript interpreter, a
rangecheck
error occurs. If a required entry is missing or its value is of the wrong
type, a
typecheck error occurs. sethalftone
sets a graphics state parameter whose effect is device dependent. It should
not be used in a page description that is intended to be device independent.
ERRORS:
limitcheck,
rangecheck,
stackunderflow,
typecheck
SEE ALSO:
currenthalftone,
setscreen,
setcolorscreen
Troubleshooting index
Back to Postscript index
sethalftonephase x y sethalftonephase
- DPS sets the halftone phase parameters in the graphics state. x and y
are integers specifying the new halftone phase, interpreted in device space.
sethalftonephase sets a graphics state parameter whose effect is device
dependent. It should not be used in a page description that is intended
to be device independent.
ERRORS:
stackunderflow,
typecheck
SEE ALSO:
currenthalftonephase
Troubleshooting index
Back to Postscript index
sethsbcolor hue saturation brightness sethsbcolor
- sets the color space to DeviceRGB, then sets the current color parameter
in the graphics state to a color described by the parameters hue, saturation,
and brightness, each of which must be a number in the range 0 to 1. This
establishes the color subsequently used to paint shapes, such as lines,
areas, and characters on the current page. Note that the color value entered
by sethsbcolor is immediately converted into the RGB model and used with
the DeviceRGB color space. HSB is not a color space in its own right, merely
a means for entering RGB color values in a different coordinate system.
sethsbcolor does not give a rangecheck error for a value outside the range
0 to 1; it substitutes the nearest legal value.
Execution of this operator is not permitted in certain circumstances.
ERRORS:
stackunderflow,
typecheck,
undefined
SEE ALSO:
currenthsbcolor,
setrgbcolor,
setcolorspace,
setcolor
Troubleshooting index
Back to Postscript index
setlinecap int setlinecap
- sets the line cap parameter in the graphics state to int, which must be
one of the integers 0, 1, or 2. This establishes the shape to be put at
the ends of open subpaths painted by the stroke operator .
The integers select the following shapes:
- Butt cap -the stroke is squared off at the endpoint of the path. There
is no projection beyond the end of the path.
- Round cap -a semicircular arc with diameter equal to the line width
is drawn around the endpoint and filled in.
- Projecting square cap -the stroke continues beyond the endpoint of
the path for a distance equal to half the line width and is squared off.
ERRORS:
rangecheck,
stackunderflow,
typecheck
SEE ALSO:
currentlinecap,
setlinejoin,
stroke
Troubleshooting index
Back to Postscript index
setlinejoin int setlinejoin
- sets the line join parameter in the graphics state to int, which must
be one of the integers 0, 1, or 2. This establishes the shape to be put
at corners in paths painted by the stroke operator .
The integers select the following shapes:
- Miter join
-the outer edges of the strokes for the two segments are extended until
they meet at an angle, as in a picture frame. If the segments meet at too
sharp an angle, a bevel join is used instead. This is controlled by the
miter limit parameter established by
setmiterlimit.
- Round join
-a circular arc with diameter equal to the line width is drawn around the
point where the segments meet and is filled in, producing a rounded corner.
stroke draws a full circle at this point. If path segments shorter than
one-half the line width meet at sharp angles, an unintentional "wrong
side" of this circle may appear.
- Bevel join
-the meeting path segments are finished with butt end caps (see
setlinecap);
then the resulting notch beyond the ends of the segments is filled with
a triangle. Join styles are significant only at points where consecutive
segments of a path connect at an angle. Segments that meet or intersect
fortuitously receive no special treatment. Curved lines are actually rendered
as sequences of straight line segments, and the current line join is applied
to the "corners" between those segments. However, for typical
values of the flatness parameter (see
setflat), the
corners are so shallow that the difference between join styles is not visible.
ERRORS:
rangecheck,
stackunderflow,
typecheck
SEE ALSO:
currentlinejoin,
setlinecap,
stroke,
setmiterlimit
Troubleshooting index
Back to Postscript index
setlinewidth num setlinewidth
- sets the line width parameter in the graphics state to num. This controls
the thickness of lines rendered by subsequent execution of the stroke operator.
stroke paints all points whose perpendicular distance from the current path
in user space is less than or equal to one-half the absolute value of num.
The effect produced in device space depends on the current transformation
matrix (CTM) in effect at the time of the stroke.
If the CTM specifies scaling by different factors in the x and y dimensions,
the thickness of stroked lines in device space will vary according to their
orientation. A line width of zero is acceptable: It is interpreted as the
thinnest line that can be rendered at device resolution-in other words,
one device pixel wide. Some devices cannot reproduce one-pixel lines, and
on high-resolution devices, such lines are nearly invisible.
Since the results of rendering such "zero-width" lines are device
dependent, their use is not recommended. The actual line width achieved
by stroke can differ from the requested width by as much as two device pixels,
depending on the positions of lines with respect to the pixel grid. One
can enable automatic stroke adjustment (by
setstrokeadjust)
to assure uniform line width.
ERRORS:
stackunderflow,
typecheck
SEE ALSO:
currentlinewidth,
stroke,
setstrokeadjust
Troubleshooting index
Postscript
Index
setmatrix matrix setmatrix
- replaces the current transformation matrix (CTM) in the graphics state
by the value of matrix.
This establishes an arbitrary transformation from user space to device space
without reference to the former CTM. Except in device setup procedures,
use of setmatrix should be very rare. PostScript language programs should
ordinarily modify the CTM (by use of the
translate,
scale,
rotate, and
concat operators) rather than replace it.
ERRORS:
rangecheck,
stackunderflow,
typecheck
SEE ALSO:
currentmatrix,
defaultmatrix,
initmatrix,
rotate,
scale,
translate,
concat
Troubleshooting index
Back to Postscript index
setmiterlimit num setmiterlimit
- sets the miter limit parameter in the graphics state to num, which must
be a number greater than or equal to 1. The miter limit controls the stroke
operator's treatment of corners when miter joins have been specified (see
setlinejoin).
When path segments connect at a sharp angle, a miter join results in a spike
that extends well beyond the connection point. The purpose of the miter
limit is to cut off such spikes when they become objectionably long. At
any given corner, the miter length is the distance from the point at which
the inner edges of the stroke intersect to the point at which the outside
edges of the strokes intersect-in other words, the diagonal length of the
miter.
This distance increases as the angle between the segments decreases. If
the ratio of the miter length to the line width exceeds the miter limit
parameter, stroke treats the corner with a bevel join instead of a miter
join. The ratio of miter length to line width is directly related to the
angle j between the segments in user space by the formula:
Examples of miter limit values are: 1.415 cuts off miters (converts them
to bevels) at angles less than 90 degrees, 2.0 cuts off miters at angles
less than 60 degrees, and 10.0 cuts off miters at angles less than 11 degrees.
The default value of the miter limit is 10. Setting the miter limit to 1
cuts off miters at all angles so that bevels are always produced even when
miters are specified.
ERRORS:
rangecheck,
stackunderflow,
typecheck
SEE ALSO:
currentmiterlimit,
stroke,
setlinejoin
Troubleshooting index
Back to Postscript index
setobjectformat int setobjectformat - LEVEL 2
establishes the number representation to be used in binary object sequences
written by subsequent execution of printobject and writeobject. Output produced
by those operators will have a token type that identifies the representation
used.
The int operand is one of the following :
- Disable binary encodings (see below).
- High-order byte first, IEEE standard real format.
- Low-order byte first, IEEE standard real format.
- High-order byte first, native real format.
- Low-order byte first, native real format.
Note that any of the latter four values specifies the number representation
only for output. Incoming binary encoded numbers use a representation that
is specified as part of each token (in the initial token type character).
The value 0 disables all binary encodings for both input and output. That
is, the PostScript language scanner treats all incoming characters as part
of the ASCII encoding, even if a token starts with a character code in the
range 128 to 159.
The printobject and writeobject operators are disabled; executing them will
cause an undefined error. This mode is provided for compatibility with certain
existing PostScript language programs. The initial value of this parameter
is implementation dependent. A program must execute setobjectformat to generate
output with a predictable number representation.
Modifications to the object format parameter obey save and restore. In a
Display PostScript system, which supports multiple contexts, this parameter
is maintained seperately for each context.
ERRORS:
rangecheck,
stackunderflow,
typecheck
SEE ALSO:
currentobjectformat,
printobject,
writeobject
Troubleshooting index
Back to Postscript index
setoverprint bool setoverprint - LEVEL 2
sets the overprint parameter in the graphics state. This rendering parameter
is used when the device is producing separations.
It specifies whether painting on one separation causes the corresponding
areas of other separations to be erased (false) or left unchanged (true).
setoverprint sets a graphics state parameter whose effect is device dependent.
It should not be used in a program that is intended to be device independent.
ERRORS:
stackunderflow,
typecheck
SEE ALSO:
currentoverprint,
setcolorspace
Troubleshooting index
Back to Postscript index
setpacking bool setpacking - LEVEL 2
sets the array packing mode to the specified boolean value. This determines
the type of executable arrays subsequently created by the PostScript language
scanner. The value true selects packed arrays; false selects ordinary arrays.
The packing mode affects only the creation of procedures by the scanner
when it encounters program text bracketed by /{
and } during interpretation
of an executable file or string object, or during execution of the token
operator.
It does not affect the creation of literal arrays by the [ and ] operators
or by the array operator. Modifications to the array packing mode parameter
obey save and restore. In a Display PostScript system, which supports multiple
contexts, this parameter is maintained seperately for each context.
EXAMPLE:
systemdict /setpacking known
/{
/savepacking currentpacking def true setpacking } if
...Arbitrary procedure definitions
... systemdict /setpacking known /{
savepacking setpacking} if
This illustrates how to use packed arrays in a way that is compatible with
Level 1 and Level 2 interpreters. If the packed array facility is available,
the procedures represented by "arbitrary procedure definitions"
are defined as packed arrays; otherwise, they are defined as ordinary arrays.
This example is careful to preserve the array packing mode in effect before
its execution.
ERRORS:
stackunderflow,
typecheck
SEE ALSO:
currentpacking,
packedarray
Troubleshooting index
Back to Postscript index
setpagedevice dict setpagedevice - LEVEL 2
installs a new raster output device in the graphics state based on a combination
of the information in the current device and the information found in the
dictionary operand.
The dictionary is a container for communicating requests as property-value
pairs, which are logically passed by value and copied by the setpagedevice
machinery into internal storage.
Calls to setpagedevice are cumulative: information established in a previous
call to setpagedevice will persist unless overridden explicitly in a subsequent
call.
Therefore, there are no required keys in any particular call. This behavior
applies not only to the top-level dictionary, but recursively to the sub-dictionaries
Policies, InputAttributes, and OutputAttributes.
The result of executing setpagedevice is to instantiate a device, perform
the equivalent of initgraphics and erasepage, and install the device as
an implicit part of the graphics state. The effects of setpagedevice are
subject to save and restore, gsave and grestore, and setgstate. setpagedevice
can be used by system administrators to establish a default state of the
device by executing it as part of an unencapsulated job.
This default state persists until the next restart of the PostScript interpreter.
Some PostScript interpreter implementations store some of the device values
in persistent storage when setpagedevice is executed as part of an unencapsulated
job, making those parameters persist through interpreter restart. setpagedevice
reinitializes everything in the graphics state, including parameters not
affected by initgraphics. Device-dependent rendering parameters, such as
halftone, transfer functions, flatness, and color rendering, are reset to
built-in default values or to ones provided in the Install procedure of
the page device dictionary.
When the device in the current graphics state is not a page device, such
as after
nulldevice has been executed,
or when an interactive display device is active, setpagedevice creates a
new device from scratch before merging in the parameters from dict. The
properties of that device are specific to each implementation.
ERRORS:
configurationerror,
typecheck,
rangecheck,
stackunderflow,
limitcheck,
invalidaccess
SEE ALSO:
currentpagedevice,
nulldevice,
gsave,
grestore
Troubleshooting index
Postscript
Index
setpattern pattern setpattern - LEVEL 2
comp1 ... compn pattern setpattern
- establishes the specified pattern as the current color in the graphics
state. Subsequent painting operations (except
image
and
colorimage) use the pattern to tile
the areas of the page that are to be painted.
The pattern operand is a pattern dictionary and instantiated by makepattern.
setpattern is a convenience operator that sets the current color space to
Pattern, then sets the current "color" to a specific pattern.
Normally, setpattern establishes a Pattern color space whose underlying
color space parameter is the color space in effect prior to execution of
setpattern.
However, if the current color space is already a Pattern color space, setpattern
leaves it unchanged. setpattern then invokes setcolor with the operands
given to setpattern.
The behavior depends on the PaintType entry of the pattern dictionary:
- If pattern defines a colored pattern (PaintType is 1), the color of
the pattern is part of the pattern itself; there are no underlying color
components.
Therefore, the comp1 ... compn operands of setpattern should not be specified.
- If pattern defines an uncolored pattern (PaintType is 2), the pattern
itself has no color; the color must be specified separately by the operands
comp1 ... compn, interpreted as components of the underlying color space
of the Pattern color space.
If the Pattern color space does not have an underlying color space parameter,
a
rangecheck error occurs.
setpattern is equivalent to:
currentcolorspace 0 get
/Pattern ne /{
[/Pattern currentcolorspace] setcolorspace} if setcolor
Execution of this operator is not permitted in certain circumstances.
ERRORS:
rangecheck,
stackunderflow,
typecheck,
undefined
,
invalidid
SEE ALSO:
findresource,
makepattern,
setcolor,
setcolorspace
Troubleshooting index
Back to Postscript index
setrgbcolor red green blue setrgbcolor
- sets the color space to DeviceRGB, then sets the current color parameter
in the graphics state to a color described by the parameters red, green,
and blue, each of which must be a number in the range 0 to 1. This establishes
the color subsequently used to paint shapes, such as lines, areas, and characters,
on the current page.
For an explanation of these color parameters. setrgbcolor does not give
a rangecheck for a value outside the range 0 to 1; it substitutes the nearest
legal value.
Execution of this operator is not permitted in certain circumstances.
ERRORS:
stackunderflow,
typecheck,
undefined
SEE ALSO:
currentrgbcolor,
setgray,
sethsbcolor,
setcolorspace,
setcolor
Troubleshooting index
Back to Postscript index
setscreen frequency angle proc setscreen
- num1 num2 halftone setscreen
- sets the halftone parameter in the graphics state. The frequency operand
is a number that specifies the screen frequency, measured in halftone cells
per inch in device space.
The angle operand specifies the number of degrees by which the halftone
screen is to be rotated with respect to the device coordinate system.
The proc operand is a PostScript procedure defining the spot function, which
determines the order in which pixels within a halftone cell are whitened
to produce any desired shade of gray.
A
rangecheck occurs if proc returns
a result outside the range -1 to 1.
A
limitcheck occurs if the size of the
screen cell exceeds implementation limits. setscreen sets the screens for
all four color components (red, green, blue, and gray) to the same value.
setcolorscreen sets the screens individually.
If the topmost operand is a halftone dictionary instead of a procedure,
setscreen performs the equivalent of sethalftone and discards the other
two operands. setscreen sets a graphics state parameter whose effect is
device dependent. It should not be used in a page description that is intended
to be device independent.
Execution of this operator is not permitted in certain circumstances.
ERRORS:
limitcheck,
rangecheck,
stackunderflow,
typecheck
SEE ALSO:
currentscreen,
sethalftone
Troubleshooting index
Postscript
Index
setshared bool setshared - LEVEL 2
has the same semantics as setglobal. This operator is defined for compatibility
with existing Display PostScript applications.
ERRORS:
stackunderflow,
typecheck
SEE ALSO:
setglobal
Troubleshooting index
Back to Postscript index
setstrokeadjust bool setstrokeadjust - LEVEL 2
sets the stroke adjust parameter in the graphics state to bool. If bool
is true, automatic stroke adjustment will be performed during subsequent
execution of
stroke and related operators, including
strokepath .
If bool is false, stroke adjustment will not be performed. The initial value
of the stroke adjustment parameter is device dependent; typically it is
true for displays and false for printers.
It is set to false when a font's BuildChar or BuildGlyph procedure is called,
but the procedure can change it. It is not altered by
initgraphics.
ERRORS:
stackunderflow,
typecheck
SEE ALSO:
currentstrokeadjust,
stroke
Troubleshooting index
Back to Postscript index
setsystemparams dict setsystemparams - LEVEL 2
attempts to set one or more system parameters whose keys and new values
are contained in the dict operand. The dictionary is merely a container
for key-value pairs; setsystemparams reads the information from the dictionary,
but does not retain the dictionary itself. System parameters whose keys
are not mentioned in dict are left unchanged.
Each parameter is identified by a key, which is always a name object. The
value is usually (but not necessarily) an integer. If the named system parameter
does not exist in the implementation, it is ignored. If the specified value
is the correct type, but is not achievable by the implementation, the nearest
achievable value is substituted without error indication.
Some user parameters have default values that can be specified as system
parameters with the same names. Permission to alter system parameters is
controlled by a password. The dictionary must contain an entry named Password
whose value is the system parameter password (a string or integer).
If the password is incorrect, setsystemparams executes an
invalidaccess
error and does not alter any parameters. Some system parameters can be set
permanently in non-volatile storage that survives restarts of the PostScript
interpreter. This capability is implementation dependent. No error occurs
if parameters cannot be stored permanently.
EXAMPLE:
/MaxFontCache 500000 /MaxFontItem 7500 /Password (xxxx) >> setsystemparams
This attempts to set the MaxFontCache system parameter to 500000 and to
set the default value of the MaxFontItem user parameter to 7500.
ERRORS:
invalidaccess,
stackunderflow,
typecheck
SEE ALSO:
currentsystemparams,
setuserparams,
setdevparams
Troubleshooting index
Back to Postscript index
settransfer proc settransfer
- sets the transfer function parameter in the graphics state. The proc operand
must be a procedure that can be called with a number in the range 0 to 1
(inclusive) on the operand stack and will return a number in the same range.
This procedure adjusts the values of the gray color component. settransfer
actually sets the transfer functions for all four color components (red,
green, blue, and gray) to the same value.
setcolortransfer
sets the transfer functions individually. settransfer sets a graphics state
parameter whose effect is device dependent. It should not be used in a page
description that is intended to be device independent.
Execution of this operator is not permitted in certain circumstances.
ERRORS:
stackunderflow,
typecheck
SEE ALSO:
currenttransfer,
setcolortransfer,
sethalftone
Troubleshooting index
Back to Postscript index
setucacheparams mark blimit setucacheparams - LEVEL 2
sets user path cache parameters as specified by the integer objects above
the topmost mark on the stack, then removes all operands and the mark object
as if by
cleartomark. The number of
cache parameters is variable and may increase in future versions of the
PostScript interpreter.
If more operands are supplied to setucacheparams than are needed, the topmost
ones are used and the remainder ignored. If too few are supplied, setucacheparams
implicitly inserts default values between the mark and the first supplied
operand. blimit specifies the maximum number of bytes that can be occupied
by the reduced representation of a single path in the user path cache.
Any reduced path larger than this is not saved in the cache. Changing blimit
does not disturb any paths that are already in the cache. A blimit value
that is too large is automatically reduced to the maximum permissible value
without error indication.
Modifications to the cache limit parameter obey
save
and
restore. In a Display PostScript system,
which supports multiple contexts, this parameter is maintained separately
for each context. The parameter that setucacheparams sets is the same as
the MaxUPathItem user parameter set by setuserparams.
ERRORS:
rangecheck,
typecheck,
unmatchedmark
SEE ALSO:
ucachestatus,
setuserparams
Troubleshooting index
Back to Postscript index
setundercolorremoval proc setundercolorremoval - LEVEL 2
sets the undercolor removal function parameter in the graphics state. The
proc operand must be a procedure that may be called with a number in the
range 0.0 to 1.0 (inclusive) on the operand stack and that will return a
number in the range -1.0 (to increase the color components) to +1.0 (to
decrease the color components).
This procedure computes the amount to subtract from the cyan, magenta, and
yellow components during conversion of color values from DeviceRGB color
space to DeviceCMYK. setundercolorremoval sets a graphics state parameter
whose effect is device dependent.
It should not be used in a page description that is intended to be device
independent.
Execution of this operator is not permitted in certain circumstances.
ERRORS:
stackunderflow,
typecheck,
undefined
SEE ALSO:
currentundercolorremoval,
setblackgeneration
Troubleshooting index
Back to Postscript index
setuserparams dict setuserparams - LEVEL 2
attempts to set one or more user parameters whose keys and new values are
contained in the dict operand. The dictionary is merely a container for
key-value pairs; setuserparams reads the information from the dictionary,
but does not retain the dictionary itself.
User parameters whose keys are not mentioned in dict are left unchanged.
Each parameter is identified by a key, which is always a name object. The
value is usually (but not necessarily) an integer. If the named user parameter
does not exist in the implementation, it is ignored.
If the specified value is the correct type, but is not achievable by the
implementation, the nearest achievable value is substituted without error
indication.
Some user parameters have default values that are system parameters with
the same names. These defaults can be set by setsystemparams. User parameters,
unlike system parameters, can be set without supplying a password. Alterations
to user parameters are subject to
save and
restore.
In a Display PostScript system, which supports multiple execution contexts,
user parameters are maintained separately for each context.
EXAMPLE: /MaxFontItem 7500 >> setuserparams
This attempts to set the MaxFontItem user parameter to 7500.
ERRORS:
invalidaccess,
stackunderflow,
typecheck
SEE ALSO:
currentuserparams,
setsystemparams,
setdevparams
Troubleshooting index
Back to Postscript index
setvmthreshold int setvmthreshold - LEVEL 2
sets the allocation threshold used to trigger garbage collections. If the
specified value is less than the implementation-dependent minimum value,
the threshold is set to that minimum value.
If the specified value is greater than the implementation-dependent maximum
value, the threshold is set to that maximum value. If the value specified
is -1, then the threshold is set to the implementationdependent default
value. All other negative values result in a
rangecheck
error. Modifications to the allocation threshhold parameter obey
save
and
restore.
In a Display PostScript system, which supports multiple contexts, this parameter
is maintained seperately for each context. The parameter specified by setvmthreshold
is the same as the VMThreshold user parameter set by
setuserparams.
ERRORS:
rangecheck
SEE ALSO:
setuserparams
Troubleshooting index
Back to Postscript index
shareddict - shareddict dict LEVEL 2
is the same dictionary as
globaldict.
The name shareddict is defined for compatibility with existing Display PostScript
applications.
ERRORS:
stackoverflow
SEE ALSO:
globaldict
Troubleshooting index
Back to Postscript index
SharedFontDirectory - SharedFontDirectory dict LEVEL 2
is the same dictionary as
GlobalFontDirectory.
The name SharedFontDirectory is defined for compatibility with existing
Display PostScript applications.
ERRORS:
stackoverflow
SEE ALSO:
GlobalFontDirectory
Troubleshooting index
Back to Postscript index
show string show
- paints the characters identified by the elements of string on the current
page starting at the current point, using the font face, size, and orientation
specified by the most recent setfont or selectfont.
The spacing from each character of the string to the next is determined
by the character's width, which is an (x, y) displacement that is part of
the character's definition. When it is finished, show adjusts the current
point in the graphics state by the sum of the widths of all the characters
shown. show requires that the current point initially be defined (for example,
by a
moveto); otherwise, it executes the
error
nocurrentpoint.
If a character code would index beyond the end of the font's Encoding, or
the character mapping algorithm goes out of bounds in other ways, a
rangecheck
error occurs.
ERRORS:
invalidaccess,
invalidfont,
nocurrentpoint,
rangecheck,
stackunderflow,
typecheck
SEE ALSO:
ashow,
awidthshow,
widthshow,
kshow,
cshow,
xshow,
yshow,
xyshow,
charpath,
moveto,
setfont
Troubleshooting index
Back to Postscript index
showpage - showpage
- % different in the NeXT implementation
This standard PostScript operator has no effect if the current device is
a window. transmits the current page to the raster output device, causing
any marks painted on the current page to appear. showpage then executes
the equivalent of
erasepage (usually)
and
initgraphics (always) in preparation
for composing the next page.
If the device is a page device that was installed by setpagedevice (a Level
2 feature), the detailed behavior of showpage is determined by parameters
of the device dictionary .
The main actions are as follows:
- showpage executes the EndPage procedure in the device dictionary.
It passes two operands to EndPage, a page count and a reason indicator.
The EndPage procedure is expected to return a boolean result. The default
EndPage procedure always returns true.
- If the result from EndPage is true, showpage transmits the page to
the output device and executes the equivalent of erasepage. If the result
is false, showpage does not transmit the page or execute an
erasepage.
- showpage executes the equivalent of
initgraphics.
- showpage executes the BeginPage procedure in the device dictionary,
passing it a page-count operand.
For a device that produces physical output, such as printed paper, showpage
optionally produces multiple copies of each page as part of transmitting
it to the output device (step 2, above). The number of copies is specified
in one of two ways. If the device dictionary contains a NumCopies entry
whose value is a nonnegative integer, that is the number of copies.
Otherwise, showpage looks up the value of#copies in the environment of
the dictionary stack. The default value of#copies is 1, defined in
userdict.
The#copies method for specifying number of copies is available in Level
1 implementations. The behavior of showpage is further modified by the Collate,
Duplex, and perhaps other entries in the device dictionary.
Whether or not the device is a page device, the precise manner in which
the current page is transmitted is device dependent. For certain devices,
such as displays, no action is required because the current page is visible
while it is being composed.
EXAMPLE:
/#copies 5 def showpage
This prints five copies of the current page, then erases the current page
and initializes the graphics state.
ERRORS: (none)
SEE ALSO:
copypage,
erasepage,
setpagedevice
Troubleshooting index
Back to Postscript index
sin angle sin real
returns the sine of angle, which is interpreted as an angle in degrees.
The result is a real.
ERRORS:
stackunderflow,
typecheck
SEE ALSO:
cos,
atan
Troubleshooting index
Back to Postscript index
sqrt num sqrt real
returns the square root of num, which must be a non-negative number. The
result is a real.
ERRORS:
rangecheck,
stackunderflow,
typecheck
SEE ALSO:
exp
Troubleshooting index
Back to Postscript index
srand int srand
- initializes the random number generator with the seed int, which may be
any integer value. Executing srand with a particular value causes subsequent
invocations of rand to generate a reproducible sequence of results.
ERRORS:
stackunderflow,
typecheck
SEE ALSO:
rand,
rrand
Troubleshooting index
Back to Postscript index
stack any1 ... anyn stack any1
... anyn writes text representations of every object on the stack to the
standard output file, but leaves the stack unchanged. stack applies the
= operator to each element of the stack,
starting with the topmost element. See the
=
operator for a description of its effects.
ERRORS: (none)
SEE ALSO:
pstack,
=,
==,
count
Troubleshooting index
Back to Postscript index
stackoverflow (error)
The operand stack has grown too large. Too many objects have been pushed
on the stack and not popped off. Before invoking this error, the interpreter
creates an array containing all elements of the operand stack (stored as
if by
astore), resets the operand stack
to empty, and pushes the array on the operand stack.
Troubleshooting index
Back to Postscript index
stackunderflow (error)
An attempt has been made to remove an object from the operand stack when
it is empty. This usually occurs because some operator did not have all
of its required operands on the stack.
Troubleshooting index
Back to Postscript index
StandardEncoding - StandardEncoding array
pushes the standard encoding vector on the operand stack. This is a 256-element
literal array object, indexed by character codes, whose values are the character
names for those codes. For an explanation of encoding vectors. StandardEncoding
is not an operator; it is a name in
systemdict
associated with the array object. StandardEncoding is the Adobe standard
encoding vector used by most Roman text fonts, but not by special fonts,
such as Symbol. A new Roman text font having no unusual encoding requirements
should specify its Encoding entry to be the value of StandardEncoding rather
than define its own private array.
ERRORS:
stackoverflow
SEE ALSO:
ISOLatin1Encoding,
findencoding
Troubleshooting index
Back to Postscript index
start - start
- is executed by the PostScript interpreter when it starts up. After setting
up the VM (restoring it from a file, if appropriate), the interpreter executes
the name start in the context of the default dictionary stack (
systemdict,
globaldict, and
userdict).
The procedure associated with the name start is expected to provide whatever
top-level control is required-for example, for receiving page descriptions,
interacting with a user, or recovering from errors. The precise definition
of start depends on the environment in which the PostScript interpreter
is operating. It is not of any interest to ordinary PostScript language
programs and the effect of executing it explicitly is undefined.
ERRORS: (none)
SEE ALSO:
quit
Troubleshooting index
Back to Postscript index
startjob bool password startjob bool LEVEL 2
conditionally starts a new job whose execution may alter the initial VM
for subsequent jobs. The bool operand specifies whether the new job's side
effects are to be persistent. The behavior of startjob depends on whether
all three of the following conditions are true:
- The current execution context supports job encapsulation-in other
words, is under the control of a job server.
- The password is correct-in other words, matches the StartJobPassword
system parameter.
- The current level of save nesting is not any deeper than it was at
the time the current job started. If all three conditions are satisfied,
startjob performs the following actions:
1. Ends the current job-in other words, resets the stacks and, if the current
job was encapsulated, executes a restore.
2. Begins a new job. If the bool operand is true, the usual save at the
beginning of the job is omitted, enabling the new job to make persistent
alterations to the initial VM. If the bool operand is false, the usual save
is performed, encapsulating the new job.
3. Returns true on the operand stack.
If any of the three conditions is not satisfied, startjob pushes false on
the operand stack. It has no other effect. The password is a string that
authorizes switching between encapsulated and unencapsulated jobs. If password
is an integer, it is first converted to a string, as if by
cvs.
It is compared to the StartJobPassword system parameter, which is established
by means of the
setsystemparams operator
.
ERRORS:
invalidaccess,
stackunderflow,
typecheck
SEE ALSO:
exitserver,
setsystemparams,
save,
restore
Troubleshooting index
Back to Postscript index
status file status bool
string status pages bytes referenced created true (if found)
false (if not found)
If the operand is a file object, status returns true if it is still valid
(i.e., is associated with an open file), false otherwise. If the operand
is a string, status treats it as a file name according to the conventions
of "Named Files." If there is a file by that name, status pushes
four integers of status information followed by the value true; otherwise,
it pushes false.
The four integer values are:
- pages
- Storage space occupied by the file, in implementation dependent units.
- bytes Length of file in characters.
- referenced Date and time when the file was last referenced for reading
or writing.
The interpretation of the value is according to the conventions of the underlying
operating system. The only assumption that a program can make is that larger
values indicate later times. created Date and time when the information
in the file was created.
ERRORS:
invalidaccess,
stackoverflow,
stackunderflow,
typecheck
SEE ALSO:
file,
closefile,
filenameforall
Troubleshooting index
Back to Postscript index
statusdict - statusdict dict
pushes a product-dependent dictionary on the operand stack. statusdict is
not an operator; it is a name associated with the dictionary in systemdict.
The statusdict dictionary is in local VM and is writable. statusdict contains
product-dependent operators and other data whose names and values vary from
product to product, and sometimes from one version of a product to another.
Information in statusdict is associated with unique features of a product
that cannot be accessed in any standard way.
The contents of statusdict are not documented here, but in product-specific
documentation. In Level 1 implementations, statusdict includes operators
to select print-engine features, to set communication parameters, and to
control other aspects of the interpreter's operating environment. In Level
2, most of these functions have been subsumed by standard operators, such
as
setpagedevice,
setdevparams,
and
setsystemparams. statusdict is not necessarily
defined in all products. Any reference to statusdict in a PostScript language
program impairs the portability of that program.
ERRORS:
stackoverflow,
undefined
Troubleshooting index
Back to Postscript index
stop - stop
- terminates execution of the innermost, dynamically enclosing instance
of a stopped context, without regard to lexical relationship.
A stopped context is a procedure or other executable object invoked by the
stopped operator. stop pops the execution stack down to the level of the
stopped operator. The interpreter then pushes the boolean true on the operand
stack and resumes execution at the next object in normal sequence after
the stopped. It thus appears that stopped returned the value true, whereas
it normally returns false. stop does not affect the operand or dictionary
stacks.
Any objects pushed on those stacks during the execution of the stopped context
remain after the context is terminated. If stop is executed when there is
no enclosing stopped context, the interpreter prints an error message and
executes the built-in operator
quit. This
never occurs during execution of ordinary user programs.
ERRORS: (none)
SEE ALSO:
stopped,
exit
Troubleshooting index
Back to Postscript index
stopped any stopped bool
executes any, which is typically, but not necessarily, a procedure, executable
file, or executable string object. If any runs to completion normally, stopped
returns false on the operand stack.
If any terminates prematurely as a result of executing stop, stopped returns
true on the operand stack. Regardless of the outcome, the interpreter resumes
execution at the next object in normal sequence after stopped.
This mechanism provides an effective way for a PostScript language program
to "catch" errors or other premature terminations, retain control,
and perhaps perform its own error recovery.
EXAMPLE:
/{
... } stopped /{
handleerror} if
If execution of the procedure /{
...} causes an error,
the default error-reporting procedure is invoked (by handleerror).
In any event, normal execution continues at the token following the if.
ERRORS:
stackunderflow
SEE ALSO:
stop
store key value
Troubleshooting index
Back to Postscript index
store store
- searches for key in each dictionary on the dictionary stack, starting
with the topmost (current) dictionary. If key is found in some dictionary,
store replaces its value by the value operand. If key is not found in any
dictionary on the dictionary stack, store creates a new entry with key and
value in the current dictionary. If the chosen dictionary is in global VM
and value is a composite object whose value is in local VM, an
invalidaccess
error occurs .
EXAMPLE:
/abc 123 store /abc where /{
} /{
currentdict} ifelse
/abc 123 put
The two lines of the example have the same effect.
ERRORS:
dictfull,
invalidaccess,
limitcheck,
stackunderflow
SEE ALSO:
def,
put,
where,
load
Troubleshooting index
Back to Postscript index
string int string string
creates a string of length int, each of whose elements is initialized with
the integer 0, and pushes this string on the operand stack.
The int operand must be a non-negative integer not greater than the maximum
allowable string length . The string is allocated in local or global VM
according to the current VM allocation mode.
ERRORS:
limitcheck,
rangecheck,
stackunderflow,
typecheck,
VMerror
SEE ALSO:
length,
type
Troubleshooting index
Back to Postscript index
stringwidth string stringwidth wx wy
calculates the change in the current point that would occur if string were
given as the operand to show with the current font. wx and wy are computed
by adding together the width vectors of all the individual characters in
string and converting the result to user space.
They form a distance vector in x and y describing the width of the entire
string in user space. To obtain the character widths, stringwidth may execute
the descriptions of one or more of the characters in the current font and
may cause the results to be placed in the font cache.
However, stringwidth prevents the graphics operators that are executed from
painting anything into the current page. Note that the "width"
of a string is defined as movement of the current point. It has nothing
to do with the dimensions of the character outlines (see
charpath
and
pathbbox).
ERRORS:
invalidaccess,
invalidfont,
rangecheck,
stackunderflow,
typecheck
SEE ALSO:
show,
setfont
Troubleshooting index
Back to Postscript index
stroke - stroke
- paints a line following the current path and using the current color.
This line is centered on the path, has sides parallel to the path segments,
and has a width (thickness) given by the current line width parameter in
the graphics state (see
setlinewidth).
stroke paints the joints between connected path segments with the current
line join (see
setlinejoin) and the ends of open
subpaths with the current line cap (see
setlinecap).
The line is either solid or broken according to the dash pattern established
by setdash.
Uniform stroke width can be assured by enabling automatic stroke adjustment
(see
setstrokeadjust). The parameters in
the graphics state controlling line rendition (line width, line join, and
so on) are consulted at the time stroke is executed.
Their values during the time the path is being constructed are irrelevant.
A degenerate subpath is a subpath consisting of a single point closed path
or two or more points at the same coordinates. If a subpath is degenerate,
stroke paints it only if round line caps have been specified, producing
a filled circle centered at that point.
If butt or projecting square line caps have been specified, stroke produces
no output, because the orientation of the caps would be indeterminate. If
a subpath consists of a single point non-closed path, no output is produced.
stroke implicitly performs a newpath after it has finished painting the
current path. To preserve the current path across a stroke operation, use
the sequence
gsave
stroke
grestore
ERRORS:
limitcheck
SEE ALSO:
setlinewidth,
setlinejoin,
setmiterlimit,
setlinecap,
setdash,
setstrokeadjust,
ustroke
Troubleshooting index
Back to Postscript index
strokepath - strokepath
- replaces the current path with one enclosing the shape that would result
if the stroke operator were applied to the current path. The path resulting
from strokepath is suitable as the implicit operand to fill, clip, or pathbbox.
In general, this path is not suitable for stroke, as it may contain interior
segments or disconnected subpaths produced by strokepath's stroke to outline
conversion process.
ERRORS:
limitcheck
SEE ALSO:
fill,
clip,
stroke,
pathbbox,
charpath
Troubleshooting index
Back to Postscript index
sub num1 num2 sub
difference returns the result of subtracting num2 from num1. If both operands
are integers and the result is within integer range, the result is an integer.
Otherwise, the result is a real.
ERRORS:
stackunderflow,
typecheck
,
undefinedresult
SEE ALSO:
add,
div,
mul,
idiv,
mod
Troubleshooting index
Back to Postscript index
syntaxerror (error)
The scanner has encountered program text that does not conform to the PostScript
language syntax rules. This can occur either during interpretation of an
executable file or string object, or during explicit invocation of the token
operator. Because the syntax of the PostScript language is simple, the set
of possible causes for a syntaxerror is very small:
systemdict - systemdict dict
pushes the dictionary object systemdict on the operand stack . systemdict
is not an operator; it is a name in systemdict associated with the dictionary
object.
ERRORS:
stackoverflow
SEE ALSO:
errordict,
globaldict,
userdict
Troubleshooting index
Back to Postscript index
Original file name: PS.html