I've read the man page for enscript
but cannot find the answer to this problem. I am trying to print using enscript
with a downloaded AFM file but I can't get it to work. I keep getting the following error:
$ enscript foo.txt -B -f OCRA10 -p - > foo.ps;
couldn't open AFM file for font "OCRA", using default
I have downloaded the AFM file for OCRA and it is located at /usr/share/fonts/ocr/OCRA.afm
. I've rebuilt the font cache with fc-cache -fv
. I also added a local enscript config file with the path for AFM files:
$ cat ~/.enscriptrc
AFMPath: /usr/share/fonts/ocr
Any help would be greatly appreciated.
Best Answer
Rather than scanning all AFM files looking for the name of the given font,
enscript
only scans thefont.map
text file. This file is a simple two-column ASCII file where each line has the formatFontName filename
. If you place the AFM file inenscript
'safm
directory (on my system it's located at/usr/share/enscript/afm
) and then add a line in thefont.map
file (located in the same directory), it will then be able to find and use the font.I don't know but would guess that any path you give in the
AFMPath:
field of the config file would also need afont.map
file. This would be necessary if you don't have root access to the system and cannot write toenscript
's directory.