Numeric values normally follow their respective options as separate arguments. However, they may also be suffixed to the option string, optionally preceded by a colon or equals sign, as long as the resulting string contains no white space. Thus, -scale 0.5, -scale0.5, -scale=0.5, and -scale:0.5 are equivalent.
Dimensional values are expressed as signed, and possibly fractional, numbers immediately followed by a units designator, one of:
bp big point (1in = 72bp) cc cicero (1cc = 12dd) cm centimeter dd didot point (1157dd = 1238pt) in inch mm millimeter (10mm = 1cm) pc pica (1pc = 12pt) pt point (72.27pt = 1in) sp scaled point (65536sp = 1pt)
These dimensions are identical to those recognized by the TeX typesetting system, with the extension that an omitted units specifier defaults to big points, which are the standard \*(Ps units. Thus, 1.0in, 2.54cm, 25.4mm, 72bp, and 72 all express the same dimension: one inch.
x79ps recognizes these options:
For compatibility, x79ps follows PLOT79 in using linewidths measured in 1/300 inch dots.
This option can be specified to define a scale factor of something other than 1; fractional values are allowed. Linewidth scale values of 4 to 8 may prove satisfactory for later reproduction. Less conveniently, the value of the LINEWIDTHSCALE macro in the output \*(Ps can be subsequently changed with a text editor. See the section MODIFYING THE OUTPUT \*(Ps below for details.
Specification of a linewidth scale factor of 0 is legal; it gives the thinnest lines the \*(Ps output device is capable of rendering.
Adobe documentation says the limit is normally 1500 points; x79ps uses a limit of 1400 by default.
This approach preserves the original color definitions in the output \*(Ps so that they can be subsequently restored just by changing the color remap function definitions.
The image size is set by the PLOT79 program, and recorded in the initialize command in the x79(1L) file.
By default, the lower-left corner of the image is positioned at (0.5in, 0.5in) from the page corner, in order to move it away from the unprintable area near the paper edges. This translation is suppressed by the -epsf option.
The format of the input files is described in another manual page, x79(1L).
Since x79(1L) can handle other file formats, such as the popular Tektronix 401x binary graphics file format, an x79 dump command can be used to convert them to x79(1L) format, and then x79ps can convert that output to \*(Ps. This method is superior to normal \*(Xw screen dumps, because such dumps are limited by the screen and color map resolution, whereas the x79(1L) files store coordinates as 16-bit signed integers, and color values as 16-bit unsigned integers. This higher precision is sufficient to address any dot on 100 inches (2.5 m) of 300 dot/inch laser printer paper, or 21 inches (0.55 m) of high-resolution phototypesetter paper, and to provide for the color ranges of all existing color \*(Ps devices.
Color definitions in the form of (red, green, blue) triples with intensities in the range 0.0 ... 1.0 are recorded as \*(Ps macros of the form
/C62 {0.562493 0.937499 0.812497 setrgbcolor} bind def
This example says that color number 62 is 56% red, 94% green, and 81% blue. It is selected for drawing by the appearance of the name C62 anywhere after its point of definition. Generally, each unique color is defined only once (PLOT79 usually arranges that, but other programs that produce x79-compatible files may not), but it may be used any number of times subsequently. The CORE Graphics System on which PLOT79 is based supports 256 different colors, but x79ps will allow any number.
Since each color is stored under a unique \*(Ps name, there is no reason that color numbers need to fall in a contiguous range. Normally, color numbers should be unsigned integers. In the CORE system, colors 0 ... 7 are permanently assigned, and color 0 is black (or background), and color 7 is white (or foreground). PLOT79 always outputs definitions of colors 0 ... 7 in x79(1L) files, even if they are never used.
If the number of colors is increased beyond 256, then the x79psdict dictionary size must be increased accordingly in the output \*(Ps file prolog section.
Output file lines are filled to about 72 characters; this makes them more convenient to edit, and immune from electronic mail system line truncation. Leading and trailing blanks on each line are stripped, but initial tabs are not; tabs are used to make multi-line macros more readable.
All comments from the x79(1L) input file are translated to \*(Ps comments, so the output file contains a record of its origins, including creation dates, file names, program names, user names, and software versions.
For readability by humans, a new line is begun for each move command, each macro definition, and each comment copied from the input file.
Because laser printers are incapable of printing near the paper edges, x79ps normally translates the picture 0.5 inch (1.27 cm) in from the lower left page corner; the command that accomplishes this is
OFFSET_X OFFSET_Y T
where the offsets have been defined earlier in \*(Ps units of big points. You can modify the translation if needed, most conveniently by using the -xoffset and -yoffset command-line options. If the -epsf option is specified, the values of OFFSET_X and OFFSET_Y are simply set to zero.
The linewidth scale factor can be set either by the x79ps -linewidthscale # option, or by modifying the output \*(Ps line
/LINEWIDTHSCALE 1 def
The numeric value # is the scale factor; setting it to 2.5 makes all lines two and a half times as wide. Setting it to 0 gives the thinnest lines the output device can produce.
Near the end of the prolog, signaled by the \*(Ps comment
%%Page: 1 1
marking the start of the first page, the command
SIZEBP SIZEUN div dup scale
changes the coordinate system from \*(Ps big points to the units defined by the x79(1L) file initialize command. For convenience, however, the linewidth is always specified in big points in commands like 2 W. The specified linewidth may be further scaled by the global LINEWIDTHSCALE value.
The image orientation is set near the end of the prolog, as one of the commands LANDSCAPE, PORTRAIT, ROTATE_0, ROTATE_90, ROTATE_180, or ROTATE_270. If you change this command, you should also adjust the %%BoundingBox limits: if the old limits were xmin, ymin, xmax, ymax, then the new limits after a rotation that changes the bounding box are xmin, ymin, xmin + (ymax - ymin), ymin + (xmax - xmin).
To facilitate modification of color values, such as for the background handling provided by the -black and -white options, the \*(Ps setrgbcolor command is redefined to apply functions REMAP_RED, REMAP_GREEN, and REMAP_BLUE to each of the three intensity values respectively. The default value of these functions is an empty procedure,
/REMAP_RED
so that the original intensities are preserved. Many other choices are possible:
/REMAP_RED
bumps the red intensity to its maximum value.
/REMAP_RED
reduces the red intensity to 75% of the specified value.
/REMAP_RED
remaps the red intensity range from 0 ... 1 to 0.25 ... 0.75.
/REMAP_RED /REMAP_GREEN /REMAP_BLUE
replaces the green and blue intensities by the red value, giving a shade of grey.
The overall size scaling provided by the -scale # option is recorded in the output as
/SCALE 1 def
You can change this to adjust the scale of the image, but you should then scale the last two %%BoundingBox coordinates too". The %%BoundingBox comment is found near the beginning of the output file. Document formatting systems which incorporate \*(Ps figures do not actually interpret the \*(Ps language (a very difficult job); they just use the lower-left and upper-right coordinate extents set in the %%BoundingBox comment to determine the size of the image.
The image size from the initialize command in the x79(1L) input file appears in the output \*(Ps file prolog as a macro like this:
/SIZECM
It defines the length of the longest extent of the bounding box in cm. Sometimes it is more convenient to change this value directly, by using the -size # option, or by editing the \*(Ps file, instead of using the -scale # option.
The x79ps -scale # and -size # commands adjust the %%BoundingBox extents according to the size scale factor, so that it will usually be more convenient to let x79ps do that job for you.
The image need not occupy the declared bounding box fully, but sometimes, you want to know what the minimal bounding box would be if surrounding white space were eliminated. x79ps computes that for you, and records it in a comment at the end of the output (since it is not known until all input has been processed):
%%MinimalBoundingBox: 0 0 396 307
You can replace the extents in the %%BoundingBox comment near the beginning of the output file with these values to get a minimal box.
The bounding box specification often causes confusion. Adobe's guidelines (\*(Ps Language Reference Manual, Second Edition, p. 713, Addison-Wesley 1990) say:
Regardless of the coordinate system in which an application operates, there is a convenient way to estimate the bounding box: Print the page, then use a point ruler to measure from the lower-left corner of the paper to the lower-left corner of the image. Then measure to the upper-right corner, also using the lower-left corner of the page as the origin. These two measurements give the bounding box and do not depend on any computation.
To this must be added the caution that many laser printers do not have the origin precisely positioned at the lower-left page corner. It is therefore useful to print a simple \*(Ps test file, such as this one:
%!PS-Adobe % Print a 5-inch rectangle at (1in,1in) 72 72 scale 1 1 moveto 5 0 rlineto 0 5 rlineto -5 0 rlineto 0 -5 rlineto closepath stroke showpage
to determine the true location of the page origin.
Center for Scientific Computing
Department of Mathematics
University of Utah
Salt Lake City, UT 84112
Tel: +1 801 581 5254
FAX: +1 801 581 4148
E-mail: <beebe@math.utah.edu>
Tektronix is a registered trademark of Tektronix, Inc.