Consistent plain text file printing between Mac and Windows

1

I have various plain text files that I'd like to print in a fixed width font. I want them to print in whatever the default is for Mac OS X / MacOS, I believe it's Monaco.ttf or some derivative at about 14pt. My pages are 80 columns x 64 rows, double-sided.

This works fine using lpr under OS X. However, in Windows 7 when I try it from Cygwin I get a different font, point size, number of columns, and on top of all that it's single-sided. The font looks like some Courier variant. I end up rebooting into OS X just to print documents.

How do I make lpr in Cygwin (or Windows) do what I want? If I can't do it with lpr, is there another way? My only requirement is that I must be able to pipe plain text into the command from within Cygwin. I don't mind shell script wrappers, nor scripts that manipulate GUI programs with AutoHotKey or the equivalent.

cjfp

Posted 2018-10-10T00:27:33.300

Reputation: 11

lpr just send to the printer. There is no filtering or processing. You need to find what filtering is performed on OS X side – matzeri – 2018-10-10T06:24:48.123

Answers

0

Install a2ps .

$ a2ps --help
Usage: a2ps [OPTION]... [FILE]...

Convert FILE(s) or standard input to PostScript.  By default, the output
is sent to the default printer.  An output file may be specified with -o.

It has several options to define the number of rows and columns or the font size in the conversion.

The default font for encoding are defined at

/usr/share/a2ps/encoding/*.edf 

To add an additional font , add the line

AppendLibraryPath: /usr/share/fonts/...

to the file /etc/a2ps-site.cfg

matzeri

Posted 2018-10-10T00:27:33.300

Reputation: 1 662

It's a good idea and I was able to install a2ps. But how do I make a2ps <options> file.txt under Cygwin print exactly the same thing as lpr file.txt under OS X? My criteria are: 1) Monaco.ttf, 2) 64 rows, 3) 80 columns, 4) 14 pt, 5) no extra headers/footers/etc. on the page. I looked at the documentation but couldn't see how to specify the font. – cjfp – 2018-10-10T14:06:00.567