
			      Genscript
			      =========

Genscript is a drop-in replacement for the enscript program.
Genscript converts ASCII files to PostScript and stores generated
output to a file or sends it directly to the printer.  

Genscript is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.

Genscript is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with genscript; see the file COPYING.  If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.


* Supported Character Sets

Genscript support following character sets:

  - ISO-8859/1		ISO latin1 (default)
  - ISO-8859/2		ISO latin2
  - ascii		7 bit ascii
  - ascii scands	7 bit ascii with following encodings:
			  '{'  =  (adieresis)
			  '|'  =  (odieresis)
			  '}'  =  (aring)
			  '['  =  (Adieresis)
			  '\\' =  (Odieresis)
			  ']'  =  (Aring)
  - IBM/PC		standard PC/DOS character set
  - Mac			Macintosh character set
  - VMS			VMS multinational charset
  - ps			PostScript font's default encoding


* Special Escapes

Genscript supports special escapes sequences that can be used to add
simple page formatting commands to ASCII documents.  User can inline
EPS files, change font on-the-fly and insert comments.  See file
README.ESCAPES for details.


* PostScript font support

** AFM files

Genscript supports AFM (Adobe Font Metrics) files.  AFM files contain
font metrics information (character widths, etc); if there is an AFM
file for the current font, genscript can count line widths and tab
stops correctly.  Genscript distribution contains AFM files for the
most common PostScript fonts.  These AFM files are installed to the
directory <prefix>/lib/genscript/afm/.

** Fonts (.pfa or .pfb)

Genscript supports additional PostScript fonts that are defined in the
.pfa or .pfb font files.  Genscript automatically preloads font's
description to your PostScript document whenever you use an external
disk font.  Font preloading requires that you have both the .afm and
.pf{a,b} files for you extra fonts and you have created a font mapping
file called 'font.map' to your font directory.

These are the steps that are needed to make your extra fonts usable in
genscript:

1) Install the .afm and .pf{a,b} files to some appropriate directory.
   Note! for a single font, both the .afm and .pf{a,b} files must have
   the same prefix, filenames can differ only from the suffix part.
   For example, if font 'FooFont' is defined in the file 'foo.pfa',
   then the AFM file must be named 'foo.afm'.  

2) Create a font map file for the font directory.  Genscript's
   distribution has an utility called 'mkafmmap' that does the job;
   just give command:

	mkafmmap *.afm

   in your font directory.  This command creates a file called
   'font.map' to your font directory.  File contains one row for each
   .afm file, and each row has two columns: font's PostScript name and
   the prefix for the corresponding .afm file.

3) Notify genscript that it has new fonts to play with.  This is done
   by editing the global configuration file 'genscript.cfg' or the
   personal configuration file '$HOME/.genscriptrc'.  Global
   configuration file has an entry called 'AFMPath' that contains the
   current font search path.  Add your new font directory to this
   path:

	AFMPath: /usr/local/lib/genscript/afm:/usr/local/lib/ps:/usr/lib/ps:/fonts/myfontdir

  where '/foo/myfontdir' is the new font directory.

So how does the font preloading work?  Genscript automatically
preloads font files for header and body fonts, if it can find
corresponding .pfa or .pfb files from the AFMPath.  Genscript do *not*
preload fonts that are specified in ^@font escapes, however you can
preload these font by specifying command line option
'--preload-font=name' for each wanted font.  You can also specify
preloadable fonts in the global configuration file 'genscript.cfg' or
in your personal configuration file '$HOME/.genscriptrc' by giving
option 'PreloadFont: name'.


* Tested Systems

Genscript have been tested on following environments.

Name			Compilers
----------------------------------------------------------------------
AIX 3.xxx		gcc 2.7.0, cc 1.3.0.0		
HPUX			gcc
IRIX 5.3		gcc 2.6.3, cc			
Linux/Slackware 1.2.1	gcc 2.7.0			
NetBSD/Amiga 1.0	gcc 2.4.5
OSF/1 V3.2		gcc 2.6.3, cc			
SunOS 4.1.3		gcc 2.6.0			
SunOS 5.3		gcc 2.7.0		


* Known Problems 

** Ghostscript does not show genscript's outputs correctly

There is one minor problem in genscript / ghostscript co-operation.
Genscript's default output media is A4 (because I live in Europe) and
GhostScript's default output media is Letter.  There are two solutions
for this problem:

 1) Fix Genscript
    Add / edit following line to file genscript.cfg:

    # Default output media.
    DefaultMedia: A4 

    =>
  
    # Default output media.
    DefaultMedia: Letter

 2) Fix GhostScript

    edit following line to file gs_init.ps:

    % Optionally choose a default paper size other than U.S. letter.
    % (a4) /PAPERSIZE where { pop pop } { /PAPERSIZE exch def } ifelse

    =>

    % Optionally choose a default paper size other than U.S. letter.
    (a4) /PAPERSIZE where { pop pop } { /PAPERSIZE exch def } ifelse
    

* What's missing / what's different in the enscript emulation?

- Currently following enscript options are not supported:

    -k	enable page prefeed
    -K	disable page prefeed

- Enscript's option '-o' has been changed.  In enscript '-o' lists
  missing characters.  In genscript '-o' is an alias for '-p' and 
  missing characters are listed with an option '-O'.


* Misc

Comments, suggestions, bug fixes, bug reports, etc are welcome.
Please, tell me what do you think about this software.  I would really
like to have feedback about it.


Markku Rossi 
	
	<mtr@iki.fi> <http://iki.fi/~mtr/>
	<mtr@niksula.cs.hut.fi> <http://www.hut.fi/~mtr/>
