Printing Woes

1 minute read

Courier PostScript Font Problems

Part of my printing woes involved printing text files. If I printed text directly to my laser printer, it would always go off the edge of the page, as if the font was bigger than the print formatter expected it to be.

Then, I observed the same thing when converting text to postscript with the excellent program enscript. Viewing the postscript file in ghostview would show the text spilling over the intended margins. This led me to believe that maybe it wasn’t just a printer issue, but a postscript or font issue.

It turns out it was a font issue. The issue is with a package called urw-fonts-2.2-6. This package is the Fedora Core 3 version of the free fonts which are the equivalents of the basic PostScript fonts. It appears that with this version, ghostscript displays bigger Courier fonts than it should. So it thinks that a certain number of Courier characters will fit on a line, but when displaying them they spill off the right side. Since my printer is PCL and not actually PostScript, ghostscript is doing the rendering of text files before they are sent to the printer to be printed. Thus both viewing in ghostview and printing directly to my printer show the too-large fonts.

My solution is to “downgrade” to urw-fonts-2.1-7. Now everything prints and view fine.

[Ref]

enscript

Enscript is an awesome program for printing text files. The best feature of it is to put two text pages per sheet of paper, side-by-side with the paper in landscape orientation:

enscript -2jr myfile.txt

That will print directly to your default printer. With the –output=output.ps option, you could output to a file called ‘output.ps’.

It even prints a nice header at the top of the page by default. You can customize everything, make interesting headers, etc. But I find that just by not printing text files in huge font and avoiding using many sheets of paper is reason enough to use it.

Here is my custom header that I use for enscript: matt.hdr. To use it, you download that file, and typically put it in /usr/share/enscript (or wherever your enscript *.hdr files are) and then execute the follwoing command:

enscript -2jr --fancy-header=matt myfile.txt

Updated: