Under macOS (Monterey), I'm trying to print text files with a specified font, unlike lpr which uses Monaco, and unlike nenscript (which I was able to build for macOS) which uses only Courier. The enscript command can do this, and can be installed with brew, but I'm trying to find a solution that I can distribute as part of a software package, and so I need a standalone version of enscript or equivalent. (I tried to build a standalone enscript, but couldn't figure out how to do it.)
I was able to extract a working version of enscript from a Snow Leopard installation, and a copy is here:
https://www.dropbox.com/s/ww86uh3wdu908rd/enscript.zip?dl=0
To use it, cd to the bin directory and enter ./enscript followed by options. I've included a text file for easy testing.
What I can't figure out is how to make enscript find the afm files in the lib/afm folder inside the enscript folder, so that I can print with one of the fonts included there. I've tried adding an AFMPath line to enscript.cfg, using both a relative and an absolute path, but enscript keeps saying that it can't find the AFM file for the font I specified.
Is there some obvious solution that I haven't seen? I'll be grateful for any help - or for an alternative method if there is one.