Table of contents


NAME

tekalw - transform Tektronix 401* graphics file into color \*(Ps

SYNOPSIS


tekalw	[-author]
	[-copies:nnnn]
	[-epsf]
	[-font:fontname]
	[-landscape]
	[-linewidth:<width>]
	[-margin:<left and right>,<bottom and top>]
	[-monochrome]
	[-offset:<lower-left-x>,<lower-left-y>]
	[-portrait]
	[-rotate:<0|90|180|270>]
	[-scale:scalefactor]
	[-size:<width>,<height>]
	[-trim]
	[-version]
	[-xoffset:<lower-left-x>]
	[-yoffset:<lower-left-y>]
	[input-Tektronix-file]
	[output-\*(Ps-file]

DESCRIPTION

tekalw converts an input Tektronix 401* graphics file into an output \*(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. Tektronix 4105 color commands are recognized and translated to color \*(Ps commands.

Several lines describing the actions of tekalw are sent to stderr; these may be sent to a log file with normal shell redirection

If the output file is omitted, stdout is used, and then if the input file is omitted, stdin is used, allowing the program to be used as a normal UNIX filter.

tekalw optimizes the vector stream by discarding duplicate vectors, and by deleting intermediate vectors which are on the same line as preceding and following ones. Output graphics commands are further compacted by expressing them in relative coordinates, with special handling of horizontal and vertical lines, and collapsing of adjacent blank characters.

Tektronix alpha mode text in any of the four supported font sizes is handled by using a default Courier font of an appropriate height to match the number of lines per page on a Tektronix screen. No attempt is made to match the font character widths.

If the initial file was produced at full resolution for a Tektronix 4014 (4095 units wide by 3119 units high), the resulting \*(Ps file should produce a plot of maximal resolution on any 400-dpi (or lower resolution) \*(Ps printer.


OPTIONS

The order, and letter case, of command options and values is not significant.

Option names may be abbreviated to a unique prefix: -la and -landscape are equivalent.

When values follow the switch name, you must separate the name from the following value by a single colon or equals sign, possibly surrounded by whitespace. On UNIX, such whitespace must be protected by shell quoting.

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.

Here are the options recognized:

-author
Display an author credit.
-copies:nnnn
Set the number of copies requested of the page created by the output file. The default is -copies:1.
-epsf
This option requests output suitable for use as an Encapsulated \*(Ps File. When specified, it forces -portrait -margin:0,0 -offset:0,0, and any values specified for these switches will be ignored.
-font:fontname
Select an alternate font for the output text. The full name or an abbreviation for the desired font type is given as fontname. The default is Courier.

The following 13 fonts are available on all \*(Ps printers. The second column provides font abbreviations used by this and earlier versions of lptops; the third column contains ditroff(1L) font abbreviations, and the fourth column, Adobe \*(Ts font abbreviations. Any of these abbreviations may be used to specify font.

	     Font		     Symbolic Names
	     ______________________________________
	     Courier		     C	   C	 C
	     Courier-Bold	     CB	   CB	 CB
	     Courier-BoldOblique     CBO   CD	 CD
	     Courier-Oblique	     CO	   CO	 CO
	     Helvetica		     H	   he	 he
	     Helvetica-Bold	     HB	   He	 He
	     Helvetica-BoldOblique   HBO   HE	 HE
	     Helvetica-Oblique	     HO	   hE	 hE
	     Symbol		     S	   S	 S
	     Times-Bold		     TB	   R	 ti
	     Times-BoldItalic	     TBI   BI	 TI
	     Times-Italic	     TI	   I	 tI
	     Times-Roman	     T	   R	 ti

The remaining fonts are available only on enhanced printers, such as the Apple LaserWriter Plus.

	 Font				Symbolic Names
	 ______________________________________________
	 AvantGarde-Book		AGB	ag   ag
	 AvantGarde-BookOblique		AGBO	aG   aG
	 AvantGarde-Demi		AGD	Ag   Ag
	 AvantGarde-DemiOblique		AGDO	AG   AG
	 Bookman-Demi			BD	Bo   Bo
	 Bookman-DemiItalic		BDI	BO   BO
	 Bookman-Light			BL	bo   bo
	 Bookman-LightItalic		BLI	bO   bO
	 Helvetica-Narrow		HN	hn   hn
	 Helvetica-Narrow-Bold		HNB	Hn   Hn
	 Helvetica-Narrow-BoldOblique	HNBO	HN   HN
	 Helvetica-Narrow-Oblique	HNO	hN   hN
	 NewCenturySchlbk-Bold		NCSB	Nc   Nc
	 NewCenturySchlbk-BoldItalic	NCSBI	NC   NC
	 NewCenturySchlbk-Italic	NCSI	nC   nC
	 NewCenturySchlbk-Roman		NCSR	nc   nc
	 Palatino-Bold			PB	Pa   Pa
	 Palatino-BoldItalic		PBI	PA   PA
	 Palatino-Italic		PI	pA   pA
	 Palatino-Roman			PR	pa   pa
	 ZapfChancery-MediumItalic	ZCMI	ZC   ZC
	 ZapfDingbats			ZD	ZD   ZD

Note that the ditroff(1L) and \*(Ts abbreviations are identical except for the Courier and Times fonts. The \*(Ts abbreviations are based on two-letter mnemonics, where upper-case in the first letter indicates bold, and upper-case in the second letter indicates italic.

Only the Courier fonts are fixed-width fonts; the others are proportionally spaced.

For convenience, if the full font name is specified, letter case does not matter; the correct name will be supplied internally.

Any font name that is not found in the above tables will be accepted verbatim.

-landscape
Display the Tektronix plot in landscape mode, rotated so that the upper-left corner of the plot is placed in the lower-left corner of the output page. This is the default.
-linewidth:<width>
Set the output line width; the default is -linewidth:1bp. When widths larger than about 4bp are chosen, a bold font should probably be selected, e.g. -font:Courier-Bold. Any \*(Ps font can be specified, but spacing will probably be wrong if the font does not have fixed-width characters; Courier and Courier-Bold are the only two such fonts standardly available on all \*(Ps devices.
-margin:<left and right>,<bottom and top>
Most Tektronix plot files use the full screen space. When plots are to be incorporated as EPS figures, it is sometimes desirable to be able to insert a padding margin around the figure. This option can be used to supply such a margin; the two dimensioned values specify the widths of the left and right, and the bottom and top, margins.

This padding is accomplished by translating the figure inward, and then increasing the %%BoundingBox extents accordingly. Programs that support EPS file inclusion use the extents specified on the %%BoundingBox comment to scale the picture to the desired size.

-monochrome
Change the color map so that all colors map to black. This may be useful on monochrome PostScript printers to prevent simulation of color by grayscale.
-offset:<lower-left-x>,<lower-left-y>
Most \*(Ps printers are unable to print near the edges of the page. It is therefore desirable to translate pictures inwards a small amount to ensure that the plot falls entirely in the printable area of the page. This option specifies the page coordinates of the lower-left corner of the bounding box; the default is -offset:1in,1in.

However, when the \*(Ps file is to be used as an EPS file, it is desirable to suppress this offsetting; just specify -offset:0,0 or better, -epsf, to accomplish that.

-portrait
Display the Tektronix plot in portrait mode.

Because the Tektronix coordinate space is wider than it is high, this does not make optimal use of the normal vertical page format, and portrait orientation is therefore not the default.

If you plan to incorporate the output as an EPS figure in a document, you probably want to specify this option to give text and plot the same orientation. Even better, you can just specify the -epsf option.

-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.
-size:<width>,<height>
Set the size of the box into which the Tektronix coordinate space (4095 units wide by 3119 units high) is to be mapped. If either <width> or <height> is zero, then the Tektronix aspect ratio will be used to recompute the zero value from the other dimension; that guarantees preservation of the original aspect ratio.

Note that the two option values are independent of the orientation (portrait or landscape) of the figure; the width value is always measured across the page, and the height, up the page.

The default is -size:6.5in,4.951in for portrait mode, and -size:6.5in,8.534in for landscape mode.

-trim
The %%BoundingBox values are computed assuming the full Tektronix coordinate ranges of 0...4095 horizontally by 0...3119 vertically. However, nothing in the Tektronix file declares how much of the coordinate space is actually used. Consequently, if the plot uses less of the coordinate space, there will be additional white space between the plot and the computed bounding box. This is sometimes undesirable, and tekalw therefore keeps track of the ranges of coordinates actually used, and then computes and outputs a %%MinimalBoundingBox.

If you specify the -trim option, tekalw will instead output the minimal extents in the %%BoundingBox line, and the normal ones in a %%NormalBoundingBox line.

You would probably not want to use -trim on a series of frames from an animation, since the result would be pictures whose scale changed, unless each frame had a bounding box actually drawn in it to start with.

If -trim and -margin are both specified, the trim request is ignored, since it would otherwise just discard that margin. Eliminating that restriction would require a second pass through the Tektronix file to determine the true extents beforehand, since they would be needed to compute another translation before any vectors were output.

-version
Display the program version.
-xoffset #
Move the lower-left corner of the image right horizontally by the specified dimensioned number. This option, together with -yoffset, is equivalent to the -offset option.
-yoffset #
Move the lower-left corner of the image up vertically by the specified dimensioned number. This option, together with -xoffset, is equivalent to the -offset option.

MODIFYING THE OUTPUT \*(Ps

To facilitate specification of dimensions other than \*(Ps big points, the output file contains a macro inch that converts its argument from inches to big points. Its use is illustrated below.

The output file contains an explicit

/#copies 1 def

line; you can edit this to get more than one copy, or better, just use the -copies:nnnn option to set it.

The text font is specified by a line which looks something like

/FONTNAME /Courier def

You can edit this line to change the font.

The width and height from the -size option are recorded in the output file in the definitions of macros which look something like

/Width  { 6.50000 inch} def
/Height { 8.53399 inch} def

You can edit these values to change the output plot size.

The plotted line width is defined by a line of the form

0.0138889 inch setlinewidth

You can edit this too to make the lines thicker or thinner.

By clever use of literal \*(Ps insertions before the EPS file is included, you can make it easy to scale the line width from a document that includes the EPS file. Just redefine the \*(Ps setlinewidth operator to execute the old one after multiplying its argument by an appropriate scale factor. For example,

/oldsetlinewidth /setlinewidth load def
/setlinewidth {3.14159 mul oldsetlinewidth} def

will cause whatever line widths are set in the following EPS file to be multiplied by 3.14159, making them approximately times thicker.

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).

Hint: if you find yourself making similar changes to a series of output files from tekalw, consider automating the job with a stream editor, such as the UNIX sed(1) utility.

In a plot that has character strings with leading blanks, such as might be the case for a labelled vertical axis, using a proportional-spaced font will result in incorrect string positioning, because blanks in such fonts are usually quite narrow. Here is a simple edit that will cause blanks to be resized to the width of a digit. Change the line

/T /show load def
to
/T {(0) stringwidth pop ( ) stringwidth pop sub
   0 32 4 3 roll widthshow} def
This will make the text-printing sequence
(some text) T
be executed as the sequence
(0) stringwidth pop () stringwidth pop
sub 0 32 (some text) widthshow
This changes the width of a blank to the width of a zero (digits always have the same width in any font). Fancier \*(Ps procedures using the kshow operator could be devised to give more control over the spacing of several characters, such as plus, minus, and period. Techniques such as these are not recommended for proportionally-spaced font text containing letters, because the results are likely to be quite ugly. For number strings, however, this trick can be quite useful.

To facilitate modification of color values, 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 end 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.


FILES

/usr/local/plot79/tekalw.sf3
SFTRAN3 source code
/usr/local/plot79/tekalw
executable file
/usr/local/plot79/define
various environment definitions, an appropriate subset of which should be placed in the users' .cshrc or .profile file.

SEE ALSO

document (1L), drawit(1L), grapht(1L), graph3t(1L), lptops(1L), pfort(1L), piechtt(1L), plot79-intro(1L), plot79(1L), pluto(1L), pretty(1L), rdinfo(1L), sf3(1L), slides(1L), tkvecs(1L), tmacro(1L), x79ps(1L), world(1L)

AUTHOR

Nelson H. F. Beebe, Ph.D.

Center for Scientific Computing

Department of Mathematics

South Physics Building

University of Utah

Salt Lake City, UT 84112

Tel: (801) 581-5254


BUGS

ANSI terminal escape sequences, and sequences of ESCape followed by a single unrecognized character, are discarded. This is more of a feature than a bug, since it prevents ANSI screen clear and cursor addressing commands from appearing as printed text. These sequences may appear in files from software that expects them to be displayed on Tektronix emulators.

Tektronix line styles and widths are not recognized (they are ignored, as noted in the preceding paragraph); they are not supported by the Tektronix 4010 and 4014 devices, but later models may provide them.

The PLOT79 \*(Ps display device library does not use those features, so the lack of support for them will not be noticed when tekalw is used on PLOT79 output.


NOTES

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

Tektronix is a registered trademark of Tektronix, Inc.