home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / gscript / gs261b.zoo / doc / readme.st < prev    next >
Encoding:
Text File  |  1994-01-07  |  19.2 KB  |  425 lines

  1. /*
  2.  *    Atari Ghostscript 2.61
  3.  */
  4.  
  5. GHOSTSCRIPT OVERVIEW:    9/93
  6.  
  7. Ghostscript is the GNU project's postscript language interpreter (the
  8. kernal is written and maintained by Peter Deutsch -- ghost@aladdin.com).
  9. It can be used to convert postscript files into formats suitable for
  10. non-postscript printers, or to display postscript files on the screen.
  11.  
  12. The primary enhancements to the GS 2.61 kernal are increased support
  13. for level 2 postscript, and the ability to use platform fonts in place
  14. of the (slightly deficient) GS fonts.  This ST version of GS does not
  15. make use of the platform font capability, but in principle someone
  16. could write some routines which would allow Atari GS to use GDOS or
  17. SpeedoGDOS fonts.
  18.  
  19. A good deal of the Atari-specific code has been rewritten for GS 2.61.
  20. GS now operates as a full GEM application. By default, GS will open
  21. two windows, one for the image and one for text I/O. Text I/O is slow
  22. but it is a start. I really can't think of an application where fast
  23. console I/O is needed anyway, so it shouldn't be too painful.
  24.  
  25. The binary distribution contains the executables, a bunch of postscript
  26. support files, some relevant docs, and the default Ghostscript font.
  27. Since the changes to the standard Unix GS source are now trivial, I
  28. have included the source files specific to the ST in the same archive.
  29.  
  30. The standard source and fonts for 2.61 (you can use the old fonts if
  31. you want) are available from prep.ai.mit.edu and its mirror sites, and
  32. a good number of other sites which carry unix source code, ftp.uu.net.
  33.  
  34. Towards the end of this file is a brief description of some features
  35. of Atari GS which are specific to the Atari platform. You may want to
  36. review it after getting GS installed.
  37.  
  38.  
  39. SYSTEM REQUIREMENTS:
  40.  
  41. To run GS, you probably need a minimum of 2.5M ram and 1M of free disk
  42. space (as long as you write no files to disk).  How much you can get
  43. by with really depends on the PostScript files you want to process,
  44. since alot of memory is allocated dynamically.  If you get all of the
  45. GS fonts, you will need another 3M of disk space.  I run GS on a 4M
  46. 520ST with an 85M hard drive and a monochrome monitor, so it is hard
  47. for me to estimate a minimum hardware configuration.  You can always
  48. try with less.
  49.  
  50. Keep in mind that a 300dpi image requires a little over 1M of memory,
  51. so high resolution printing requires either lots of memory or band
  52. printing (see the docs).  Color is a real memory hog, so you may have
  53. to decrease the resolution for color images (screen images cannot be
  54. printed in bands).  Documents which load lots of fonts can also hog
  55. lots of ram.
  56.  
  57. You can probably get by without a hard drive if you are willing to use
  58. only the ghostscript default font.  The font files take up about 3 Meg
  59. of disk space.  For graphics, the default font is fine, but text will
  60. be ugly.
  61.  
  62.  
  63. INSTALLATION:
  64.  
  65. In addition to the executable, you will need a set of PostScript
  66. support files, some fonts (at least the default font), and a file
  67. called fontmap.  When GS is executed, it reads a number of the
  68. PostScript files to initialize itself.  The fontmap file contains a
  69. list of which fonts reside in which disk files.  Ghostscript must be
  70. able to locate all of these files in order to execute successfully.
  71.  
  72. I have Ghostscript installed as follows:
  73.  
  74. f:\gs        GS source and executable,
  75. f:\gs\ps    GS PostScript support files and
  76.         other PostScript source (pictures),
  77. f:\gs\fonts    GS fonts.
  78.  
  79. When Ghostscript needs a file, it searchs a list of directories
  80. until it finds what it needs. Which directories it searches is
  81. determined as follows:
  82.  
  83. 1.) The current directory is searched first.
  84.  
  85. 2.) Directories to be searched can be specified from the GS command
  86. line with the -I option.
  87.  
  88. 3.) Directories specified by the GS_LIB environment variable are
  89. checked next.  Gem users may be unfamiliar with environment variables.
  90. Basically, this is just a global variable stored by the computer in a
  91. location which is accessible by all programs running on the machine.
  92. Most shells have commands that allow you to set environment variables.
  93. If you are running from the desktop, you may need an auto-folder
  94. program (I believe GEMENV is the name of one such program) which will
  95. set environment variables for you.
  96.  
  97. If GS cannot find the files it needs, it will look to see if the
  98. environment variable GS_LIB has been defined.  If the environment
  99. variable GS_LIB is "c:\gs,d:\gs,e:\gs" GS will search the directories
  100. c:\gs, d:\gs, and e:\gs in sequence for the files that it needs.  This
  101. comma-separated list of directories is called a "path".
  102.  
  103. 4.) If all else fails, GS searches a default path of
  104. ".,f:\gs,f:\gs\ps,f:\gs\fonts", which is compiled into GS.  This
  105. corresponds to my setup.  When GS needs a file, it first looks in the
  106. current directory (.), then in f:\gs, then in f:\gs\ps, and finally in
  107. f:\gs\fonts.
  108.  
  109. If your installation corresponds to the default path, you need not
  110. worry about any environment variables.  If the directories used in
  111. your installation do not correspond to the default path, you will want
  112. to set up your computer to automatically define GS_LIB to be a COMMA
  113. separated path (corresponding to your setup) for ghostscript to
  114. search.  If you specify file paths on the command line, you may use
  115. either '/' or '\' as a path separator.
  116.  
  117. To install:
  118.  
  119. 1) Copy gs261b.zoo to the desired directory (f:\gs to use the default
  120.     search path).
  121.  
  122. 2) Unpack the archive with 'zoo e// gs261b.zoo'
  123.     This will produce a directory structure as follows:
  124.     . (current directory)    GS executable,
  125.     .\ps            GS PostScript support files and examples,
  126.     .\fonts            Default font and fontmap.
  127.  
  128.     If you want the root gs directory to be somewhere besides
  129.     f:\gs, define the environment variable GS_LIB to be a comma
  130.     separated search path which contains the files in the
  131.     'ps' and 'fonts' directories. You will probably want to
  132.     set up your system so that this environment variable is
  133.     defined    automatically at boot time (or you can use gemGS
  134.     to define it whenever GS is run).
  135.  
  136. USAGE:
  137.  
  138. To use ghostscript:
  139.  
  140. 1) To display a file on the screen:
  141.     Type 'gs file1.ps file2.ps ...' on the command line. The default
  142.     device is the screen at 80 dpi. You can specify (with the -r
  143.     option) as much resolution as you have memory for, but it may
  144.     take forever to construct your image. See the file use.doc
  145.     for how to change the device.
  146.  
  147.     GS will open a console window, and will write some initialization
  148.     messages to it. The mouse will turn to a busy bee while GS is
  149.     creating a bitmap of the image. If you are using the screen
  150.     (stvdi) device, an image window will eventually open and the
  151.     image will be displayed (this can take a long while for complicated
  152.     files or high resolutions). You can then scroll around the image
  153.     using the scroll bars or the cursor keys.
  154.  
  155.     Usually the last postscript command on a PS page will be
  156.     "showpage". The showpage command causes the page to be displayed
  157.     and then waits for the user to enter a <return> before proceeding
  158.     to the next page. When all pages have been displayed, GS displays
  159.     a GS> prompt in the console window. Postscript commands typed in
  160.     the console window will then be executed by the PS interpreter. For
  161.     example, typing "(file.ps) run" after the prompt will cause
  162.     file.ps to be displayed. This is a useful thing to know, since
  163.     it allows you to display more images without having to wait
  164.     through another long GS initialization. The output device and
  165.     the image resolution may also be changed from the command line
  166.     using the putdeviceprops command. See the docs for details. I
  167.     plan to make these actions available from menu selections in
  168.     later versions. Typing "quit" at the command line will cause
  169.     GS to exit.
  170.  
  171.     Selecting the Run entry of the File menu allows postscript
  172.     files to be selected with the file selector. The selected
  173.     file will automatically    be sent to the interpreter. I think
  174.     the other menus are self-explanatory.
  175.  
  176.     If the environment variable GS_WIN is set to "off", then windows
  177.     will not be used. In this case, you can move around the image with
  178.     the cursor keys, and type "q" when you have finished viewing
  179.     the image. Press the help key for further information.
  180.  
  181. 2) To use a printer device:
  182.     Type "gs -sDEVICE=djet500 file.ps" for a
  183.     deskjet 500, "gs -sDEVICE=epson file.ps", etc. Type "gs -h" for
  184.     a list of available printer devices. I found it convenient to
  185.     define a shell alias for "gs -sDEVICE=djet500". The printer output
  186.     will be written in a file called "gs_pr.XXX", where XXX is a
  187.     unique number. See the docs for other ways to select a device
  188.     or to see which devices are installed. Output can be redirected
  189.     to a file of your choosing, or to the printer with the
  190.     "-sOutputFile=filename" option. OutputFile=PRN: or CEN: will
  191.     send output to the printer port (CEN: prints faster, but is
  192.     less compatible).
  193.  
  194. 3) To send the output file to the printer:
  195.     Since it is a binary graphics file, you will
  196.     need a print utility which does NOT try to add carriage
  197.     returns and such at ends of lines. I wrote a small program
  198.     to print these files, called 'bpr'. It was intended for a
  199.     DeskJet, but it apparently works reasonably well with other
  200.     printers. Bpr is available from lifshitz.ph.utexas.
  201.  
  202.  
  203. ATARI FEATURES:
  204.  
  205. Here is a brief overview of the Atari-specific features:
  206.  
  207. 1.) Windows are now used by default.  When GS is started, a console
  208. window is opened and stdin, stdout, and stderr are directed to it.
  209. This makes GS a real GEM application, and eliminates some awkwardness
  210. with using windows in earlier versions.  Windows may be disabled by
  211. setting the GS_WIN environment variable to "off".  This is different
  212. from the previous usage of the GS_WIN variable.  Despite the added GEM
  213. functionality, GS can still require a large number of command line
  214. parameters.  For this reason, users may still find some use for gemGS,
  215. a GEM shell which I wrote for GS.  GemGS 1.3 should still work well
  216. with GS 2.61, except that the windows option in GemGS should be turned
  217. off.  This prevents GemGS from forcing several GS command line
  218. parameters which are no longer necessary, but GS 2.61 will still use
  219. windows.
  220.  
  221. The console and image windows are standard, with all of the standard
  222. gadgets.  Everything operates in the normal fashion, except for the
  223. arrow buttons in the scroll bars of the image window.  These normally
  224. scroll one line, which makes little sense for an image.  So, I used
  225. these buttons for "top of page", "bottom of page", etc.  Note that
  226. closing the console window will cause GS to exit.
  227.  
  228. The x coordinate of the console window will always snap to the nearest
  229. word, so it may not end up exactly where you put it when you move the
  230. window.  This is an attempt to keep the text word aligned, which is
  231. supposed to improve text output speed.
  232.  
  233. 2.) The stvdi screen device supports 1-, 2-, 4-, 8-, and another attempt
  234. at 16-bit color.  The 16-bit color has not been thoroughly tested, so
  235. it may not work properly, if at all.  There are some improvements in
  236. the way 2 and 4 bit color are handled, which should result in better
  237. speed, more free memory, and more accurate color.  Please note that
  238. only so much that can be done with 2-bit color.
  239.  
  240. Vdi routines are used to determine the screen parameters and to copy
  241. to the screen, so graphics should work with lots of different screen
  242. devices.  The price of compatibility, however, is alot of image
  243. transformation.  Some transformations are now written in assembler in
  244. an attempt to speed things up a bit.
  245.  
  246. The screen driver allocates colors dynamically as the GS kernal
  247. requests them.  For 2 and 4 bit color, GS spaces colors equally
  248. throughout the color cube, and then approximates the needed colors by
  249. dithering the two closest colors in the palette.  Because of the
  250. dynamic color allocation, you may see colors changing on your screen
  251. while GS is running.  In all but 2-bit mode, GS attempts to avoid
  252. changing the color of the desktop, so if your foreground and
  253. background colors are black and white, you shouldn't see too many
  254. disturbing color changes.  Of course, the original palette is restored
  255. when GS exits.  Thanks to Markus Wenzel for the routines to set and
  256. save the color palette.  In the future, I will try to make these color
  257. changes a little less disconcerting.
  258.  
  259. 3.) There are two ways to send output directly to the printer.
  260. Including '-sOUTPUTFILE=PRN:' on the command line will send output to
  261. the centronics port via Gemdos.  The name 'OutputFile' can be used
  262. instead of 'OUTPUTFILE' if desired.  The option '-sOUTPUTFILE=CEN:'
  263. will write output directly to the centronics port.  The routines for
  264. direct centronics output were contributed by Chris Strunk
  265. (CS-TeX)--THANKS!  Direct centronics output is generally much faster
  266. (about a factor of 4 for heavy graphics).  For some unknown reason,
  267. the CEN: option does not work properly on some STEs and TTs.  (A
  268. solution to this problem will probably require the debugging efforts
  269. of someone who has this difficulty.)
  270.  
  271. For those with an Atari SLM printer, this driver sends output directly
  272. to the printer (running the Diablo emulator), so there is no need to
  273. specify the OUTPUTFILE. Some problems have been reported with using
  274. the old Diablo emulator, so the newest one is recommended.
  275.  
  276. 4.) The number of available drivers has increased to the point that it
  277. is not feasible to include all that an ST owner might reasonably use.
  278. The current choice of 21 drivers was decided mostly by a vote of GS
  279. users on the internet (a couple were included at my whim).  Type 'gs
  280. -h' for a list of the available drivers.
  281.  
  282. stvdi    - The screen device. Supports 1, 2, 4, 8, and 16 bit color,
  283. slm      - Atari SLM laser printer (thanks to Robert Stabl),
  284. gemimg   - GEM bitmap format (thanks to Marcus Haebler),
  285. djet500  - HP DeskJet 500,
  286. djet500c - Color HP DeskJet 500,
  287. cjd500   - Another DeskJet 500c driver -- higher quality output -- slower,
  288. cjd550   - DeskJet 550c driver,
  289. laserjet - HP LaserJet (and old deskjets),
  290. bj10e    - Cannon BubbleJet,
  291. escp2    - Epson esc p2 language printers, including the Stylus 800,
  292. epson    - Epson 9 and 24 pin printers (limited resolutions),
  293. eps9high - High resolution Epson 9-pin device (makes multiple passes),
  294. epsonc   - Color epson printers,
  295. necp6     - NEC 360 dpi printer,
  296. gifmono  - GIF monochrome bitmap format,
  297. gif8     - GIF 8-bit color format,
  298. pbmraw   - Mono portable bitmap format,
  299. ppmraw   - Color portable bitmap format,
  300. filter   - Filter device,
  301. dps      - Display postscript (partial implementation),
  302. level2   - Level 2 postscript (partial implementation).
  303.  
  304. The following environment variables are specific to the Atari port
  305. of GS. See use.doc for standard environment variables (like GS_LIB).
  306.  
  307. GS_WIN:    Set this to "off" to disable windows. Otherwise the value of
  308.     this variable is ignored.
  309.  
  310. GS_DISPLAY: Set this to "chunky8" to tell GS that your screen hardware
  311.     uses chunky pixel format. I don't think any graphics boards
  312.     actually use this format, but if they do, this will allow GS
  313.     to skip two image format transformations and save some time.
  314.     Otherwise GS will transform GS's native chunky format to standard
  315.     GEM color planes, and then transform back to chunky format for
  316.     display.
  317.  
  318. GS_DEBUG: This is used by me during debugging. I doubt it is of interest
  319.     to anyone else.
  320.  
  321.  
  322. KNOWN BUGS, LIMITATIONS and POSSIBLE PROBLEMS:
  323.  
  324. See the doc files for some known bugs and problems.
  325.  
  326. 1.) 16 bit color is still under construction; it may not work properly.
  327.  
  328. 2.) Control-C to abort printing is not handled very gracefully.
  329.  
  330. 3.) Fatal errors can cause GS to close the console window before the
  331.     error message can be read.
  332.  
  333. 4.) Some PageStream output tickles a bug in the GS kernal, causing a
  334.     crash.
  335.  
  336. 5.) The CEN: output option does not work properly on some STEs and TTs.
  337.  
  338. 6.) Programs which talk control of the printer port can interfere with
  339.     Ghostscript's Atari SLM laser printer device. Also, you should
  340.     have the latest Diablo emulator to avoid output problems under
  341.     MultiTOS.
  342.  
  343.  
  344. TIPS:
  345.  
  346. Here are a few miscellaneous tips.
  347.  
  348. 1) Read the supplied documentation! It is a bit sparse for beginners,
  349.     but it is helpful and is quicker than sending me questions.
  350.     Use.doc is the most important file for casual users. GS is
  351.     an excellent tool for learning PostScript programming, but
  352.     it is not the intention of the docs to teach PS to you.
  353.     If you want to learn PostScript programming, you will probably
  354.     need to buy a PS programming book.
  355.  
  356. 2) Try to arrange things so that you don't have to restart GS very
  357.     often. This startup takes a good deal of time. Once GS has
  358.     displayed an image, another can be displayed by typing
  359.     "(file.ps) run" on the command line, or by selecting a
  360.     file using the Run entry of the File menu. If you MUST
  361.     restart GS often, putting the initialization files in a
  362.     ram disk significantly decreases initialization time
  363.     (at least on my system).
  364.  
  365. 3) There is a GEM shell for ST-GS, called gemGS. You may
  366.     find it useful if you hate typing command lines. Also, gemGS
  367.     allows the selection of individual pages from large documents,
  368.     although this feature is rather slow. GemGS 1.2 is compatible
  369.     with GS 2.41, and gemGS 1.3 is intended for GS 2.52 and GS 2.61.
  370.     When using GemGS 1.3 with GS 2.61, turn off the windows option
  371.     in GemGS.
  372.  
  373. 4) The ps directory contains some files on which to test ghostscript.
  374.     These are some of the files that where used to test the port.
  375.  
  376. 5) GS can be used to view or print the output of dvips (TeX dvi to PS
  377.     translator). The combination of TeX (a typesetting program), dvips,
  378.     and GS can be used to preview TeX documents which contain graphics
  379.     at high resolution (if you need this sort of thing and have the
  380.     memory). I have gone up to 300dpi and it seems to work OK. Dvips
  381.     allows PS graphics to be easily included in TeX documents.
  382.  
  383. 6) You can change the ghostscript prompt by editing the gs_init.ps file.
  384.     Search the file for GS or >, and then change this to whatever you
  385.     want the prompt to be. Many other changes can be made in this
  386.     file to alter the behavior of GS. For example, you can redefine
  387.     the 'showpage' command so that it doesn't wait around for a
  388.     CR to be typed after every page (this can be done from the
  389.     command line also).
  390.  
  391. 7) You may find interesting things in the following Usenet newsgroups:
  392.     gnu.ghostscript.bug
  393.     comp.lang.postscript
  394.     comp.sources.postscript
  395.  
  396. ACKNOWLEDGMENTS:
  397.  
  398. Many kind people have contributed to the Atari version of Ghostscript.
  399. Some of the more direct contributions are:
  400.  
  401. Hauke Hess:    Original screen driver upon which stvdi was based,
  402. Robert Stabl:    The Atari SLM laser printer driver,
  403. Marcus Haebler:    360 dpi NEC P6 and GEM image drivers,
  404. Chris Strunk:    Contributed code for direct centronics printing,
  405. Steve Eker:    Contributed assembly image transformation algorithms,
  406. Steven Ourada:    Contributed assembly image transformation algorithms,
  407. Markus Wenzel:    Color palette save and restore routines,
  408. J. Bammi:    For gcc and numerous library bug fixes.
  409.  
  410. Please forgive me if I forgot to mention an important contribution,
  411. and gently remind me of my omission.
  412.  
  413. FOR MORE INFO:
  414.  
  415. The original source files, docs, and fonts can be obtained from
  416. many places. I obtained the ones I used from "ftp.uu.net".
  417.  
  418. Send bug reports to:
  419.  
  420. Tim Gallivan
  421. Center for Relativity
  422. University of Texas
  423. Austin, TX
  424. timg@landau.ph.utexas.edu
  425.