How to use PS

PS basically operates like SPY: it translates graphics requests to text, which it then writes to a file (or the standard output if none is specified). The environment variable ``PS$'' specifies on which file the output should go. Beware that the variable cannot be changed from within PCSCHEME. This is a strange behaviour I don't really care to deal with; but it is due to duplication of the environment.

PS accepts a wide variety of display modes, because the Postscript language is by nature pixel-independent while BGI is pixel-oriented; and the lines' width, points' size etc. are determined by the device's resolution. There are 6 normal modes, and 6 encapsulated modes. The former create output ready to send to a printer, while the latter are best suited to create images to be inserted in a document.

There is an eternal problem with color and display versus hardcopy. The colors are not changed, but the greytones are swapped. This is logical since a screen is black by default, while a blank sheet of paper is white. The driver accepts the same color requests as a SUPER-VGA card: 16 colors by default and a user-settable 256-entry palette. Here are the first preset 16 colors:

Index Color Red Green Blue
0 White 100% 100% 100%
1 Dark Blue 0% 0% 50%
2 Dark Green 0% 50% 0%
3 Dark Cyan 0% 50% 50%
4 Dark Red 50% 0% 0%
5 Dark Magenta 50% 0% 50%
6 Dark Brown 50% 50% 0%
7 Dark Grey 50% 50% 50%
8 Light Grey 75% 75% 75%
9 Blue 0% 0% 100%
10 Green 0% 100% 0%
11 Cyan 0% 100% 100%
12 Red 100% 0% 0%
13 Magenta 100% 0% 100%
14 Brown 100% 100% 0%
15 Black 0% 0% 0%
If your printer has no color capabilities, these values are converted to greytones by combining linearly the RGB percentages.

Mode Type Resolution Page Size [inches]
0 Postscript 100×100 7×7
1 Postscript 320×200 11.2×7
2 Postscript 640×480 9.333×7
3 Postscript 1024×768 9.333×7
4 Postscript 1024×1024 7×7
5 Postscript 2048×2048 7×7
6 Encapsulated 100×100 7×7
7 Encapsulated 320×200 11.200×7
8 Encapsulated 640×480 9.333×7
9 Encapsulated 1024×768 9.333×7
10 Encapsulated 1024×1024 7×7
11 Encapsulated 2048×2048 7×7
An example of PS can be seen in the Hershey sample code. PS has been used there to insert sample displays in a TEX document.

There are no restrictions nor royalties associated to the use, distibution or modification of PS and SPY.