wiki:Enscript

Version 7 (modified by trac, 17 years ago) ( diff )

--

Enscript

The testsuite says that it passes, but in fact there are some problems:

  • src/tests/toc.test: Aborts because Glibc detects double free or corruption
  • src/tests/passthrough.test: uses obsolete syntax for the "tail" command, fix it with:
    sed -i 's/tail +2/sed 1d/' src/tests/passthrough.test
    

In non-English locales, if configured without the --disable-nls option, Enscript prints question marks instead of non-ASCII characters in its messages (e.g., in "enscript --help" output). This bug can be fixed by the following command:

sed -i 's/setlocale (LC_MESSAGES, "");/setlocale (LC_CTYPE, "");&/' \
    src/main.c src/mkafmmap.c states/main.c

For printing non-ISO-8859-1 texts, additional fonts are needed. This is covered in the Enscript FAQ. Fonts that come with A2PS work. To use them, do the following:

  1. Install Enscript, A2PS and i18n-fonts
  1. From the /usr/share/a2ps/afm directory, issue the folloing command:
    mkafmmap *.afm
    
  1. Add /usr/share/a2ps/afm to the list of directories mentoned in the AFMPath line in /etc/enscript/enscript.cfg

After doing these steps, it becomes possible to print texts in encodings mentioned in the enscript(1) manual page.


Enscript cannot print UTF-8 encoded texts directly. One workaround is to convert the text to a supported encoding containing all needed characters (koi8-r in the example below):

iconv -f UTF-8 -t koi8-r utf8-encoded-file.txt | \
    enscript -p output.ps -X koi8 -f CourierISOC@10

This workaround doesn't work if there is no such encoding.

Using PAPS instead of Enscript for printing UTF-8 encoded text files is a better solution.

Up
Top

Note: See TracWiki for help on using the wiki.