README - enscript - GNU Enscript
 (HTM) git clone git://thinkerwim.org/enscript.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
       README (8756B)
       ---
            1 
            2                              GNU Enscript
            3                              ============
            4 
            5     SPECIAL NOTE TO ALL AMERICAN (USA) USERS.
            6 
            7     Enscript's default output media (paper size) is A4.  It is *not*
            8     Letter.  To change the default, give the configure script the
            9     option `--with-media=Letter'.  It goes like this:
           10 
           11       $ ./configure --with-media=Letter
           12 
           13 
           14 GNU Enscript is a drop-in replacement for the enscript program.
           15 Enscript converts ASCII files to PostScript and stores generated
           16 output to a file or sends it directly to the printer.
           17 
           18 
           19 Enscript is free software: you can redistribute it and/or modify
           20 it under the terms of the GNU General Public License as published by
           21 the Free Software Foundation, either version 3 of the License, or
           22 (at your option) any later version.
           23 
           24 Enscript is distributed in the hope that it will be useful,
           25 but WITHOUT ANY WARRANTY; without even the implied warranty of
           26 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
           27 GNU General Public License for more details.
           28 
           29 You should have received a copy of the GNU General Public License
           30 along with Enscript.  If not, see <http://www.gnu.org/licenses/>.
           31 
           32 
           33 * Configuring Enscript for your system
           34 
           35 There are some options in enscript you might want to modify to meet
           36 your system's needs.  You can change them all after the compilation by
           37 editing the global configuration file `enscript.cfg' at the directory
           38 `PREFIX/etc/'.  You can also change some of the during the `configure'
           39 step by giving the configure script appropriate options.  Please,
           40 check the following things before reporting bugs; for the most cases
           41 these help:
           42 
           43 ** Paper size
           44 
           45   As a default enscript uses A4 paper.  To change default paper to be
           46   for example `Letter', edit following line in the config file:
           47 
           48     # Default output media.
           49     DefaultMedia: A4
           50 
           51     => DefaultMedia: Letter
           52 
           53   You can also select the default paper size during the configuration
           54   by giving the configure script option --with-media=MEDIA, where
           55   media is one of the media listed in the `lib/enscript.cfg.in' file:
           56   A3, A4, A5, Legal, Letter, A4dj or Letterdj.
           57 
           58 ** Default output device
           59 
           60   As a default (without any explicit options) enscript spools its
           61   output to the printer.  If you want to send outputs to stdout, edit
           62   following line:
           63 
           64     # Where output goes as a default.
           65     DefaultOutputMethod: printer
           66 
           67     => DefaultOutputMethod: stdout
           68 
           69 ** Printer command
           70 
           71   Enscript's default printer command is `lpr'.  To change it to be for
           72   example `lp', edit following line:
           73 
           74     # Printer spooler command name.
           75     Spooler: lpr
           76 
           77     => Spooler: lp
           78 
           79   You can also set the spooler command during the configuration by
           80   giving the configure script option `--with-spooler=SPOOLER'.
           81 
           82   On SystemV machines, you might also want to change the printer queue
           83   name switch from `-P' to `-d':
           84 
           85     # The spooler command switch to select the printer queue.
           86     QueueParam: -P
           87 
           88     => QueueParam: -d
           89 
           90 ** PostScript language level
           91 
           92   The PostScript language level that enscript uses for its output.
           93   The default values is 2 (PostScript 2).  If your printer supports
           94   only level 1 PostScript, you can set it to default by giving the
           95   configure script option `--with-ps-level=1'.  You can also set the
           96   level by editing the enscript.cfg file:
           97 
           98     # The PostScript language level that enscript should use.
           99     PostScriptLevel: 2
          100 
          101     => PostScriptLevel: 1
          102 
          103   Or, you can select it at the print time with the `--ps-level=LEVEL'
          104   option:
          105 
          106     $ enscript --ps-level=1 ...
          107 
          108 
          109 * Supported Character Sets
          110 
          111 Enscript supports following character sets:
          112 
          113   - ISO-8859-1                ISO Latin1 (default)
          114   - ISO-8859-2                ISO Latin2
          115   - ISO-8859-3                ISO Latin3
          116   - ISO-8859-4                ISO Latin4
          117   - ISO-8859-5                ISO Cyrillic
          118   - ISO-8859-7                ISO Greek
          119   - ISO-8859-15                ISO Latin9
          120   - ascii                7 bit ascii
          121   - ascii fi se                7 bit ascii with following encodings:
          122                           '{'  = ä (adieresis)
          123                           '|'  = ö (odieresis)
          124                           '}'  = å (aring)
          125                           '['  = Ä (Adieresis)
          126                           '\\' = Ö (Odieresis)
          127                           ']'  = Å (Aring)
          128   - ascii dk no                7 bit ascii with following encodings:
          129                           '{'  = æ (ae)
          130                           '|'  = ø (oslash)
          131                           '}'  = å (aring)
          132                           '['  = Æ (AE)
          133                           '\\' = Ø (Oslash)
          134                           ']'  = Å (Aring)
          135   - IBM/PC                standard PC/DOS character set
          136   - Mac                        Macintosh character set
          137   - VMS                        VMS multinational charset
          138   - hp8                        HP Roman-8 charset
          139   - koi8                Adobe Standard Cyrillic Font KOI8 charset
          140   - ps                        PostScript font's default encoding
          141   - pslatin1                PostScript interpreter's `ISOLatin1Encoding'
          142 
          143 
          144 * Special Escapes
          145 
          146 Enscript supports special escapes sequences that can be used to add
          147 simple page formatting commands to ASCII documents.  User can inline
          148 EPS files, change font on-the-fly insert comments and shade regions of
          149 text.  See file README.ESCAPES for details.
          150 
          151 
          152 * Language sensitive highlighting
          153 
          154 Enscript supports language sensitive code highlighting.  Highlighting
          155 is implemented by a special `states' program which processes the input
          156 files and annotates them with enscript's special escapes.  The states
          157 definition file `enscript.st' is a machine independent ASCII file and
          158 it can be updated without re-compilation of the enscript program.  The
          159 most recent version of this file can be downloaded from the GNU
          160 enscript WWW home page: <http://www.gnu.org/software/enscript/>.
          161 
          162 New highlighting definitions for different languages are welcome,
          163 please send them to: <bug-enscript@gnu.org>
          164 
          165 
          166 * PostScript font support
          167 
          168 ** AFM files
          169 
          170 Enscript supports AFM (Adobe Font Metrics) files.  AFM files contain
          171 font metrics information (character widths, etc); if there is an AFM
          172 file for the current font, enscript can count line widths and tab
          173 stops correctly.  Enscript distribution contains AFM files for the
          174 most common PostScript fonts.  These AFM files are installed to the
          175 directory <prefix>/share/enscript/.
          176 
          177 ** Fonts (.pfa or .pfb)
          178 
          179 Enscript supports also additional PostScript fonts which are defined
          180 in the `.pfa' or `.pfb' font files.  Enscript automatically
          181 down-loads font's description to your PostScript document whenever you
          182 use an external disk font.  Font down-loading requires that you have
          183 both the `.afm' and `.pf{a,b}' files for you extra fonts and you have
          184 created a font mapping file called `font.map' to your font directory.
          185 
          186 These are the steps that are needed to make your extra fonts usable in
          187 enscript:
          188 
          189 1) Install the `.afm' and `.pf{a,b}' files to some appropriate
          190    directory.  Note! for a single font, both the .afm and .pf{a,b}
          191    files must have  the same prefix, filenames can differ only from
          192    the suffix part.  For example, if font `FooFont' is defined in the
          193    file `foo.pfa', then the AFM file must be named `foo.afm'.
          194 
          195 2) Create a font map file for the font directory.  Enscript's
          196    distribution has an utility called `mkafmmap' which does the job;
          197    just give command:
          198 
          199         mkafmmap *.afm
          200 
          201    in your font directory.  This command creates a file called
          202    `font.map' to your font directory.  File contains one row for each
          203    .afm file, each row has two columns: font's PostScript name and
          204    the prefix for the corresponding .afm file.
          205 
          206 3) Notify enscript that it has new fonts to play with.  This is done
          207    by editing the global configuration file `enscript.cfg' or the
          208    personal configuration file `$HOME/.enscriptrc'.  Global
          209    configuration file has an entry called 'AFMPath' which contains the
          210    current font search path.  Add your new font directory to this
          211    path:
          212 
          213         AFMPath: /usr/local/share/enscript/afm:/usr/local/lib/ps:/usr/lib/ps:/fonts/myfontdir
          214 
          215   where `/fonts/myfontdir' is the new font directory.
          216 
          217 So how does the font down-loading work?  Enscript automatically
          218 down-loads font files for header and body fonts, if it can find the
          219 corresponding `.pfa' or `.pfb' files from the AFMPath.  Enscript do
          220 *not* down-load fonts that are specified in `^@font' escapes, however
          221 you can down-load these font by specifying command line option
          222 `--download-font=name' for each font.  You can also specify
          223 down-loadable fonts in the global configuration file `enscript.cfg'
          224 or in your personal configuration file `$HOME/.enscriptrc' by giving
          225 option `DownloadFont: name'.
          226 
          227 
          228 * What's different as compared to the Adobe's Enscript application?
          229 
          230 - Adobe enscript's option `-o' has been changed.  In Adobe enscript
          231   option `-o' lists missing characters.  In GNU enscript `-o' is an
          232   alias for `-p' and missing characters are listed with an option `-O'.
          233 
          234 * Example Usage:
          235 
          236 1)        Defaults: create document in Helvetica 14 with default headers
          237                 enscript -f Helvetica@14 -o myfile.ps myfile.txt
          238 2)        Create document with a Latin 9 font encoding from example utf-8 with no header
          239                 cat myfile.txt | iconv -f utf-8 -t latin9 | enscript -f FreeMono@14 -B -o myfile.ps
          240                 Don't forget to install the latin9 font afm! 
          241                 You can use the tool convertfontto.sh
          242