Table of contents


NAME

x79ps - Convert PLOT79 \*(Xw files to color \*(Ps

SYNOPSIS

x79ps [ -author ] [ -black ] [ -copies # ] [ -epsf ] [ -landscape ] [ -linewidthscale # ] [ -maxpath ] [ -minlinewidth ] [ -monochrome ] [ -portrait ] [ -rotate 0|90|180|270 ] [ -scale # ] [ -size # ] [ -version ] [ -white ] [ -xoffset # ] [ -yoffset # ] < input-x79-file > output-\*(Ps-file

OPTIONS

x79ps command-line options may be spelled in either letter case, and unique prefixes of options are acceptable.

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:

-author
Display an author credit on stderr.
-black
Assume black background, and leave colors unchanged.
-copies #
Set the output page copy count to #.
-epsf
Create Encapsulated \*(Ps files for inclusion in other documents. The sole effect of this option is to suppress the translation of the image away from the unprintable areas near the page edges.
-landscape
Output the image in landscape orientation. It will be rotated 90 degrees counterclockwise and translated right by its original height so that its original upper-left corner is moved to where its lower-left corner was.
-linewidthscale #
Linewidths in x79(1L) files follow the \*(Xw convention of measurement in screen dots. Large workstation monitors are approximately 85 dots/inch (33 dots/cm), and medium size monitors are about 72 dots/inch (28 dots/cm). For hardcopy on 300 dot/inch \*(Ps laser printers, one-dot-wide lines are visible, but too thin to give good results if the images are later reduced or copied.

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.

-maxpath #
Specify an alternate limit for the maximum number of points in a path. Although the internal default should normally be adequate, \*(Ps implementations may vary in the maximum number permitted.

Adobe documentation says the limit is normally 1500 points; x79ps uses a limit of 1400 by default.

-minlinewidth #
The default linewidth in PLOT79 output is zero, which gives the thinnest line the device is capable of producing. The -linewidthscale option has no effect on such lines because the width remains zero after scaling. This option allows you to specify a minimum linewidth in dots (possibly fractional) for all lines; a positive value ensures that -linewidthscale will affect all lines.
-monochrome
Monochrome PostScript devices simulate color by using grey scale instead, which is sometimes undesirable. This option suppresses color simulation by redefining the color remap functions described in the section MODIFYING THE OUTPUT \*(Ps below to map red, green, and blue intensity components to zero (black).

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.

-portrait
Output the image in portrait orientation. This is the default.
-rotate 0|90|180|270
Rotate the image counterclockwise by the specified angle (in degrees), keeping a corner of the rotated image at the original lower-left corner position. -rotate 0 is equivalent to -portrait, and -rotate 90 is equivalent to -landscape, with the top of the image to the left of the page. -rotate 180 displays the image upside down, and -rotate 270 is reversed landscape mode, with the image top to the right of the page.
-scale #
This option can be used to multiply the image size by the indicated scale factor. A value of 0.5 will make the figure half its normal size.

The image size is set by the PLOT79 program, and recorded in the initialize command in the x79(1L) file.

-size #
This option can be used to change the image size to the indicated dimensioned value, overriding the image size set by the PLOT79 program, and recorded in the initialize command in the x79(1L) file.
-version
Display the program version string on stderr.
-white
Assume white background, and invert colors. This is the default. Screen display will normally use a black (or dark background) for maximum color contrast. When the image is printed in monochrome on white (or light-colored) paper with black toner, saturated colors would map to white, and be largely invisible. Inverting them will resolve the problem.
-xoffset #
Move the lower-left corner of the image right horizontally by the specified dimensioned number.

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.

-yoffset #
Move the lower-left corner of the image up vertically by the specified dimensioned number.

DESCRIPTION

x79ps converts output from the PLOT79 \*(Xw device driver, or the x79(1L) dump command, to a color \*(Ps file in Encapsulated \*(Ps (EPS) format. EPS files are suitable for incorporation as figures in other documents that support \*(Ps file inclusion, such as TeX files with appropriate \*(Ps DVI driver support.

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.


MODIFYING THE OUTPUT \*(Ps

On occasion, it may be desirable to modify the \*(Ps file output by x79ps. With only minor deviations, x79ps follows the conventions adopted for the PLOT79 \*(Ps device driver. The prolog of \*(Ps files from these systems contains a number of macro definitions, usually single letters chosen for mnemonic significance: M for absolute move, R for relative draw, W for set linewidth, and so on. In \*(Ps, operands precede operators, so with the x79ps macro definitions, a line from the current point to (40,60) would be written as 40 60 R. Because horizontal and vertical lines are common, special command abbreviations X and Y provide for omission of the zero coordinate.

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.


SEE ALSO

plot79(1L), plot79-intro(1L), ps4014(1L), tekalw(1L), tkvecs(1L), x79(1L)

AUTHOR

Nelson H. F. Beebe, Ph.D.

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>


NOTES

\*(Ps is a trademark of Adobe Systems Incorporated.

Tektronix is a registered trademark of Tektronix, Inc.