0

I am trying to print to my dotmatix printer from command line. How to mention the font and font size

I tried with enscript but got error

enscript -B --font=Sans@11 -p - /home/tk/Documents/bill.txt | lp -d TVS_MSP-250CH -

couldn't open AFM file for font "Sans", using default

I want to get the same experice which I get when I open the file in text and click on print

enter image description here

kumar
  • 455

1 Answers1

1

The --font option only supports a certain set of fonts named a certain way. Since you left the font choice as "Sans", you wouldn't care about which sans-serif font is used. "Helvetica" is one of those font names you can use:

enscript -B --font=Helvetica@11 -p - /home/tk/Documents/bill.txt | lp -d TVS_MSP-250CH -

If you want a serif font, use "Times-Roman". For monospace, use "Courier". These are all in https://en.wikipedia.org/wiki/PostScript_fonts#PostScript_Level_1 , meaning that the fonts are hardcoded into the printer itself and that the sending computer does not need to send the font file. enscript seems to support level 1 and level 2 fonts, but not level 3 fonts.

Daniel T
  • 4,594
  • I use a2ps for all my ASCII-to-Postscript needs. It handles fonts, character sizes, line width, multicolumn printing, Portrait/Landscape, ... Read man a2ps. – waltinator Feb 04 '24 at 14:44
  • @waltinator is there any thing which will do just print plain text without the ASCII to Postscript? this being dotmatrix printer converting to Postscript does not seem to print correctly – kumar Feb 04 '24 at 17:34