home *** CD-ROM | disk | FTP | other *** search
- PLT:
- Version 1.3
- November 16, 1989
-
- Rich Champeaux
- Jim Miller
-
-
- NOTICE: PLT: is not in the public domain. We reserve all rights to both the
- executable and the source. PLT: may not be sold without expressed,
- written permission of either Rich Champeaux or Jim Miller. PLT: is
- however, freely distributable provided that this file accompanies it.
-
-
- PLT: is a file-handler that emulates a plotter by accepting HP-GL commands,
- creating a raster image, and then dumping it to any Preferences supported
- graphics printer. The current resolution set with preferences is used,
- allowing PLT: to make full use of a printer's capability.
-
- PLT: accepts virtually all of the standard HP-GL commands, including scaling
- and text. The commands that were not implemented are those which are
- generally contained in an extended graphics cartridge, such as: circles,
- arcs, filled regions, etc.
-
-
- PLT: Features:
-
- - Lines are stored in a tree/linked list structure untill the handler is
- closed or the command AF or PG is recieved. The plot is then rasterized
- and dumped to the printer in strips. This allows plots to be printed
- with resolutions and page sizes for which a raster for the entire page
- would not fit in memory.
-
- - Pens can be assigned colors and thicknesses. The pen colors are defined
- by RGB values, and thicknesses are defined in pixel widths. The pens
- can be defined in an environment variable or when the handler is opened.
- The number of bit planes used for the raster depends on the number of
- different colors requested, not the number of pens. Therefore, 7 black
- pens and 5 red pens of various thicknesses, would only take 2 bit planes.
-
- - PLT: supports variable paper sizes. It knows the standard paper sizes,
- A, B, C, D, and E, and can also use the paper size defined by the limits
- fields of Preference's Graphic 2 screen. The entire width of any dot
- matrix printer supported by Preferences can be used, including wide
- carriage printers. If the requested page size is too large to be
- printed, a requester is displayed, giving the option to reduce the size
- of the plot (keeping the aspect ratio) to the maximum size of the
- printer. The plot can also be reduced to the page size specified by
- Preferences.
-
- - PLT: has a preview mode that displays the plot on the screen. The
- aspect ratio of the requested page is preserved. This allows the plot
- to be displayed on the screen the way it will appear on paper.
- A 640 x 400 screen is used to provide maximum resolution.
-
- - PLT: v1.3 supports multiple, disk-resident fonts. The fonts can be
- changed or created by the user. An included program, 'cf', is used to
- convert the fonts from a text representation of the vectors to a
- format usable by PLT:. Fonts are loaded in only when needed, and
- fonts can be changed durring a plot with the CS, CA, SS, and SA HP-GL
- commands. A standard ascii font and a math-greek font are included
- with this release.
-
- - PLT: can also be used by programs that assume that a plotter is
- connected to the serial port by using the CMD command. For example:
- CMD serial.device PLT:
-
- - PLT: has two memory usage modes that it can run in: memory-squander and
- memory-conserve. The memory-squander mode sits a tree structure on top
- of the linked list to speed up inserts. The memory-conserve mode uses
- only a linked list. The memory-squander mode is much faster than the
- memory-conserve mode since it's insert time is O(log2(n)), but it
- requires twice as much memory per line. The memory-conserve mode's
- insert time is O(n), and becomes unbearably slow as the number of lines
- becomes greater than about 8000. The memory-conserve mode does, however,
- allow twice as many lines to be plotted. PLT: v1.3 defaults to the
- memory-squander mode and will automatically remove the tree and switch to
- the memory-conserve mode when availble memory is less than 2k.
-
- -----------------------------------------------------------------------------
-
- Installing PLT:
-
- 1) Copy the file 'plt-handler' to the L: directory.
- 2) Create a directory and assign "PLTDATA:" to it.
- 3) copy the files 'ascii', 'math-greek', and 'pltfontnames' to the
- directory 'PLTDATA:'
- 4) Add the following to the mountlist:
-
- PLT: Handler = L:plt-handler
- StartUp = P/000-1
- StackSize = 5000
- Priority = 5
- GlobVec = 1
- #
-
-
- (Note: the StartUp field is used to pass default parameters to the
- handler. It is explained below.)
-
- 5) Mount the handler using the command 'mount PLT:'
-
- -----------------------------------------------------------------------------
-
- Switches and Pen Definitions:
-
- PLT:'s mode switches and pen definitions are recieved from three sources:
- the mountlist entry, an environment variable, and the file name path. All
- three sources use the following format:
-
- SWITCHES/RGB-t/RGB-t/RGB-t...
-
- where:
- SWITCHES could be: A..E Selects standard page sizes A,B,C,D, or E.
- (default is A)
-
- P Selects the page size specified by the
- limits fields of Preferences' Graphics 2
- screen.
-
- R Reduces the plot (keeping the aspect ratio)
- to the size specified by the limits fields
- of Preferences' Graphics 2 screen.
-
- S Draws plot on preview screen.
-
- W Displays a status window when plotting to
- printer. (default)
-
- M Forces PLT: to use the memory-conserve
- mode.
-
- L Makes the label command do a carriage
- return when it receives a line feed.
- This switch allows copatability with the
- Amiga since the newline character on the
- amiga is a linefeed.
-
- (A '-' can be prefixed to a switch to negate it.)
-
- Pens are described as: RGB-t
- where:
- RGB is the color of the pen in hex.
- t is the pen thickness in pixels. (optional,
- defaults to 1).
-
- Ex.
- SB/000-1/f00-3/0c3-2
- -WP/0f0/000-2/f30
- /000-1/0f0-1/f00-2
- DRM
- C-R/000-1
-
- The switches and pen definitions defined in the mountlist or the
- environment variable "pltinfo" are used as the defaults for PLT:. If the
- environment variable exists, the entry in the mountlist is ignored. These
- defaults can be temparily overridden by the switches and pen definitions
- passed to PLT: as the file path (Ex. PLT:SB/000-1/f00-2). The switches
- specified with the file path selectively override the defaults. For
- example, if the defaults were 'SBWR' and the switches specified in the file
- path were '-S-R' then the S and R switches would be negated, but the other
- switches would be unaffected. Defining pens in the file path, however,
- completly replaces the default pen definitions. A maximum of 15 pens can
- be defined. If a pen is selected whose number is greater than the total
- number of defined pens, then the pen number is MODed with the total number
- of defined pens.
-
- To define the switches and pen definitions in the mountlist, use the field
- 'StartUp'.
-
- Ex. StartUp = P/000-1/f00-1/0f0-1/00f-1
-
- The StartUp field appears to be limited to 39 characters and cannot start
- with a '-'. If you require more characters or a leading '-', use the
- environment variable.
-
- The enviroment variable used is "pltinfo". It is set in the following
- manner:
-
- setenv pltinfo P/000-1/f00-1/0f0-1/00f-1
-
- The enviroment variable has the advantage of being easily changed after PLT:
- has been mounted.
-
- -----------------------------------------------------------------------------
-
- Fonts:
-
- The fonts of PLT: are disk resident and user modifiable. The fonts are
- stored in the directory PLTDATA:. A file in that directory, 'pltfontnames',
- contains the names of the fonts accessible to PLT:. The file contains a list
- of font names, one name per line, that are to be associated with the font
- numbers 0 thru 50. The fonts are selected using the HP-GL character set
- commands: CS, CA, SS, SA. CS and CA designate the standard and alternate
- fonts, respectively. SS is then used to make the standard font the current
- font, and SA is used to make the alternate font the standard font. The
- default font is font 0, which is the first font listed in the file
- 'pltfontnames'.
-
- The fonts are described by a text file, whose name ends with the extension
- '.fnt', and then must be compiled with the program 'cf' before they can be
- used by PLT:. The characters consist of 1 or more strokes of the pen. Each
- character in the font has an entry which specifies the value of the character
- and a list of end points describing each stroke of the pen.
-
- The first 2 numbers in the file contain the width and height of the
- character cell. Large characters, such as capital letters should completely
- fill the cell, however, the characters are allowed to have end points that
- lie outside of the cell.
-
- The first line of each character entry consists of an '*' followed by the
- value of the character. The remaining part of the line is a comment.
- Following that are the pen strokes that make up the character. Each stroke
- consists of a number indicating the number of end points in the stroke,
- followed by the the starting location of the stroke, followed by the end
- points of the lines in the stroke. Below is an example of a character entry.
- The comments on the right are only for the documentation and should not be
- in the actual font file.
-
-
- * 48 '0' Below are comments that should not be in the actual file
- 8 <- number of end points (lines) in the first stroke.
- 12 3 <- starting point of the first stroke
- 12 18 <- end point of the first line in the stroke
- 9 21 <-|
- 3 21 <-|
- 0 18 <-|
- 0 3 <-|- more end points
- 3 0 <-|
- 9 0 <-|
- 12 3 <-|
- 1 <- number of end points (lines) in the next stroke
- 10 20 <- starting point of next stroke
- 2 1 <- end point of the only line in the second stroke
-
- The character entry is ended by the occurance of the '*' marking the next
- character entry.
-
- The font file is compiled and placed in the PLTDATA: directory by the
- program 'cf'.
-
- Ex. cf ascii
-
- The font file is assumed to end with the extension '.fnt'.
-
- The cf program is only a simple state machine, so it does not handle errors
- very well. It merely tells you what the character it discovered the error at
- was and the position of that character in the file. Source to the cf program
- is included with this release.
-
- -----------------------------------------------------------------------------
-
- Specifing the Raster Height:
-
- The maximum height of the raster that PLT: uses when it prints a strip of
- the plot can be specified by the user. The user specifies the maximum number
- of lines in the raster using the enviroment variable 'PltMaxRasHgt'.
-
- Ex. setenv PltMaxRasHgt 100
-
- Specifing the maximum raster height is a way of controlling the amount of
- memory that PLT: uses for the raster. The actual raster height that is used
- is always a multiple of the number of lines that the printer driver can print
- in one "strip" at the specified resolution. The minimum raster height, and
- the default, is the height of one "strip".
-
- -----------------------------------------------------------------------------
-
- Specifing the Left Margin:
-
- The left margin of the plot can be specified in inches using the environment
- variable 'PltXOffset'.
-
- Ex. setenv PltXOffset 0.5
-
- The value is only accurate to one tenth of an inch.
-
- -----------------------------------------------------------------------------
-
- Operation:
-
- PLT: can be used in a variety of manners.
-
- 1. You can copy files containing HP-GL commands to the handler.
- Ex. copy <filename> PLT:
-
- 2. You can direct a CAD package to plot to a file and give the
- filaname as "PLT:"
-
- 3. You can redirect output from a CAD package heading towards
- the serial port to the handler.
- Ex. cmd serial.device PLT:
-
- 4. You can write your own applications that write directly to the
- handler PLT:.
- Ex. file=fopen("PLT:","w");
-
- -----------------------------------------------------------------------------
-
- Memory:
-
- PLT: does take up quite a bit of memory. Not as much as a full raster image,
- but still quite alot.
-
- PLT: code needs 35K
- printer.device needs 49K
- raster varies from 5K - 14K
- each lines takes 28 bytes (or 16 in the Memory Conserve mode)
-
-
- Before data is read, PLT: removes about 90K - 100K from your system.
-
- An average plot will usually require an additional 30-50k.
- A complex plot will usually require about 180K or more.
-
- -----------------------------------------------------------------------------
-
-
- QUESTIONS or BUG REPORTS
-
- Since there have been so many changes to PLT: from v1.2, there are sure to
- be numerous bugs lurking in the code. Any questions or bug reports should be
- sent to the following addresses:
-
- Rich Champeaux
- rchampe@hubcap.clemson.edu
-
- or
-
- Jim Miller
- jvmiller@rdrc.rpi.edu
-
- or send US mail to:
-
- Rich Champeaux
- 11 Mansfield Dr.
- Chelmsford, MA 01824
-
- (Sending US mail to the above address will be slow, since that is my home
- address, not my school address)
-
- Every attempt will be made to solve your problems within a reasonable
- amount of time.
-
-
- | It would be appreciated if anyone using PLT: would email or US mail your
- | comments to one of the above addresses. Even an "I am using PLT:" message
- | is welcome. We have put a lot of effort into PLT: and since we did not
- | write PLT: for a profit, but merely for the ego boost, we would like to
- | know approximately how many people are using it, and what they think about
- | it. Thank you.
- |
- | Rich Champeaux
-