Ghostscript 4.03 BeOS for AAPR Alpha 1 README
------------------------------------------------------------------------------

This is the fourth release of my port of Aladdin Ghostscript 4
to BeOS.  This program will interpret Postscript and PDF files and
convert them to various image and inkjet/dot-matrix printer formats, 
including PCX, TIFF, and PNG.  Because AppSketcher and Package Builder
for DR9 aren't ready yet, I haven't released the GUI front-end and I'm using
Chris Herborth's zip port to package this version.  Here is a list of changes
since the last release:

1) Works with DR9
2) Upgraded to new version of libpng (0.96)
3) Added setup script to verify proper installation

Installation:
-------------

Run the enclosed setup.sh shell script to install the shared libraries
in /system/lib and verify that Ghostscript has been installed correctly.
If all goes well, you should see a picture of a tiger draw on your screen.
Type "quit" at the GS> prompt to exit the program.

NOTE:  If you choose a directory other than /boot/apps/Ghostscript
to install Ghostscript, for example /boot/PostScript/gs4, then you must set
the GS_LIB variable to contain both paths, for example (place this in your
/system/UserBootscript or /boot/.profile to set it permanently):

$ export GS_LIB=/boot/PostScript/gs4/4.03:/boot/PostScript/gs4/fonts

The setup script will warn about this and print the correct GS_LIB for
you to use.  If you move Ghostscript somewhere else, you can always
rerun setup.sh and see the new GS_LIB command.

To uninstall Ghostscript, remove this directory and the shared libraries
libgs.so and libgs.so.xMAP.  If you don't need the JPEG or PNG libraries
anymore, you can also remove libjpeg.so, libjpeg.so.xMAP, libpng.so,
libpng.so.xMAP, libz.so, and libz.so.xMAP from /system/lib.

Using Ghostscript:
------------------

The documentation is in the "4.03/doc" folder, and there are some sample 
Postscript files in "4.03/examples".  For example, to view a picture of a 
tiger, use the command in setup.sh ("bin/gs examples/tiger.ps").

This should output a nice image of the tiger on your screen.  Press the
close button of the window or type "quit" at the GS> prompt to quit.
It looks best in 32-bit color mode, but looks reasonable in 256
colors.  If you view a multiple page document, you must go to the Terminal
window where you started Ghostscript, and press Return to view the next
page.  Please look at the documentation, including the license
agreement (in a file called "PUBLIC" in the doc folder), and
experiment with the different options.  Let me know if you find any bugs!

Troubleshooting:
----------------
If you receive a "cannot execute binary file" or "Error launching..."
message when attempting to run Ghostscript, verify that libjpeg.so, libpng.so
and libz.so are present in /system/lib and that libgs.so is in the same
directory as "gs" or in /system/lib.  If you have any other problems,
please e-mail me:  jehamby@lightside.com
 
Known Bugs:
-----------

None.  Please report any you find!

Using libgs in your own programs:
---------------------------------

The source code to the gs executable is included in the src directory.
As you can see, it is still pretty messy.  I've used the same "DLL" API
as the Windows and OS/2 version of Ghostscript.  This is fully documented
in dll.txt in the original Ghostscript source code archive (see below).
The only difference is that the gsdll_lock_device() is not currently
written (because the PSView is automatically threadsafe), and the "HWND"
type is defined as a PSView class instead of its MS-Windows meaning.
Unfortunately, due to Ghostscript's extensive use of global variables,
you can only open one PSView per program.

Building Ghostscript from source:
---------------------------------

In the directory where you downloaded this program, I have copied
the Ghostscript source code.  This is the same as the version
available on ftp.cs.wisc.edu in /ghost.  First, you must download
and install the GNU patch program, available from from several
places, including:
    ftp://ftp.ninemoons.com/pub/be/geekgadgets/dr9/be-bin/patch-2.1-bin.tgz

After you have downloaded ghostscript-4.03.tar.gz, type the following:

$ zcat ghostscript-4.03.tar.gz | tar xvf -
$ cd gs4.03
$ cp -p ../Ghostscript/4.03/gs_res.ps .
$ cp -pr ../Ghostscript/patches/* .
$ cat patch.? | patch -p0
$ rm patch.?

If the "patches" directory which came with this archive is in a different
location relative to gs4.03, then substitute that path on the third line above.

Now, type the following commands to create the makefile, compile
the program, and (optionally) install it:

$ ./tar_cat
$ cp beosmwcc.mak makefile
$ make
$ make install

Here are some notes about my changes:

* Do not edit the makefile directly.  Instead, modify one of:
	mwcchead.mak, unixhead.mak, beostail.mak, or unix-end.mak, and
	rerun the shell script "tar_cat".  This will recreate
	beosmwcc.mak, and you can recopy it to "makefile".  As you can
	see, the BeOS-specific Makefile changes have been made to
	mwcchead.mak and beostail.mak, which are based on ansihead.mak
	and unixtail.mak, respectively.

* You can link with Motorola's LIBMOTO library by adding it to EXTRALIBS
	in mwcchead.mak.  However, it doesn't make rendering noticably faster,
	so I didn't link the binary version with it.

* There is a patch available on ftp.cs.wisc.edu, which is simply a new version
	of gs_res.ps.  This binary version has the patch already installed
	but the source code	archive on ftp.be.com doesn't.  The instructions
	above copy the version of gs_res.ps in this archive into the source
	directory before building the program, so you don't have to worry about it.

Summary:
--------

Please help me try to make Ghostscript as Be-friendly as possible.
If you have any comments or suggestions, please E-Mail to me, at:
	
jehamby@lightside.com

You can download the latest version of Ghostscript, and other Be
programs I've written from my new improved Web site:

http://people.delphi.com/jehamby/Be/

Enjoy!
