[PLUG] "text2ps.c" - 34 years of recompiling

2023-11-22 Thread Keith Lofstrom
Perhaps timewasting chatter, but the subject is a Unix/Linux
program.  So there.

I've used Unix/Linux for almost 50 years now ... my first
encounter was as a grad student at UC Berkeley, through a
friend with "legitimate" access to the machine, and to
Berkeley's ARPANET node.  

As a Tektronix employee, my first "home" Unix system was
a Tektronix 6130 running the UTek variant of Unix, around
1985.  I organized a dozen Tek engineers to order the
major assemblies for that system from engineering stock.
We plugged the pieces together, wangled copies of the 
UTek source code, and compiled our own "distro" - years
before Torvalds and Linux.

Keith Packard helped us find "new" kernels.  Typing madly,
filling the process tables with compiles on those very
limited machines, then pleasant chatter until completion
and reboot.  Remember when some brains were faster than
many computers?

Then text2ps ...

The Apple Laserwriter (native language Postscript) also
appeared in 1985.  The only Postscript drivers I knew 
about were proprietary ... except for Australian Steven
Frede's source code for "text2ps", which he wrote at 
University of New South Wales, probably around 1982. 
Just What I Needed to interface between the UTek Unix
machine and the Apple Laserwriter.

Over the many years since, I've updated and recompiled that
text2ps code for various flavors of Unix and Linux.  Before
today the last recompile was 2006.  However, the old C code
was not strictly typed. 

Today (2023 Nov 22 Weds), I tried to recompile the old code
for Debian Bookworm ... too many compiler warnings.  I am
NOT much of a programmer, but I did manage to add enough
"int" and "char" and "void" and call prototypes to the
program, so now it compiles without complaint.  Not bad for
a brain still suffering from a 70th birthday in September.

I hope C and Debian won't evolve radically much over the
next 25 years.  I'm not planning on a "dirt nap" until I
am older than my 105yo father-in-law, but my MD wife tells
me I do not have complete choice in the matter; and even
less choice if I hack until 3 in the morning.  Spoilsport.

The Apple Laserwriter is Long Gone.  Today, my main printer
is a Postscript hp4100n with multiple input trays (often
configured for Letter and A4), also a Brother MFC4400 color
printer (also Letter and A4), both with duplexing, and
swappable trays for envelopes and legal.  

I fear that my next MAJOR recompiles will be for CUPS The
Next Generation.  If CUPSng is manufacturer-driven, HP and
Brother may stop writing new drivers for very old printers
(with Very Large and Very Cheap Toner Cartridges).  
Learning how to write laser printer drivers at age 75 will
be challenging.  Making replacement toner cartridges with
desktop additive manufacturing might be even harder.



Well, back to "Bringing Up Bookworm".  I am moving Many old
Linux (mostly CentOS) machines to Debian, and translating
ancient MoinMoin websites to MediaWiki.  

Then, back to my main mission:
Changing The World, or at least The World's Poopy Diapers.

Keith

-- 
Keith Lofstrom  kei...@keithl.com


Re: [PLUG] "text2ps.c" - 34 years of recompiling

2023-11-26 Thread Ted Mittelstaedt


I'd like a copy of your text2ps.c   There are multiple copies of it floating 
around as versions of it are included in the tcm utility/utilities and the hp 
filters that can be installed in Ubuntu.  The original program was just put out 
in the Public Domain and I suspect a lot of people have applied various 
licenses to it.

Text2ps was NOT a "linux" program by any means.  It was a C program written 
back in the days when the idea was to try to write C programs that could be 
compiled on any operating system.  It just so happened that back when it was 
written nobody was running C on anything over than Unix systems.

The author is still going, here's his Linkedin profile:
https://www.linkedin.com/in/stephenfrede/?originalSubdomain=au

You ought to send him a note and tell him you are still using his program I'd 
bet he would get a kick out of it.

I never went down the Apple printer rathole "back in the day" so never had a 
Laserwriter or any other Apple printer that would ONLY print Postscript and NOT 
regular text.  But, I used that utility a few times to create test PostScript 
files which I would send to different printers to test if the Postscript they 
advertised really worked.  That was back in the days you had to buy Postscript 
chips off Ebay for your HP Laserjects and such.

It's also a quick and dirty precursor program for the ps2pdfwr  "wrapper" 
script around Ghostscipt used to create PDF files, sometimes used on websites 
that pipe Unix man pages through it for download as pdfs.

Just for fun I did the following to get the original source:

1) Go to https://www.dosbox.com/ and download and install DOSBox
2) Go to the archive site for the 1992 SImtel archive  
https://archive.org/details/Simtel20_Sept92
3) Download the simtel archive.  Rename the .CDR file to .ISO
4) Mount the Simtel ISO.  (I did this under Windows on drive D but you can do 
it on Linux obviouslt)
5) Mount the Simtel drive (drive D) as D drive on Dosbox
6) Mount some convenient directory as drive C on dosbox

In Dosbox:

a) copy pkunzip.exe c:
b) d:cd MSDOS\ARC_LBR
c) copy ARCE40G.ZIP to c:
d) cd ..   cd POSTSCPT
e) copy TEXT2PS.ARC c:
f) c:
g) pkunzip ARCE40G.IP
h) arce40g text2ps.arc

Volia - you get text2ps.exe, the C source, and you even get a man page that 
someone wrote for it.  No readme or other information on who compiled it, 
whether they modified the source to it or what they ran it through to compile 
it.

You can convert the man page/document into PostScript - under DOS- with the 
command

Text2ps text2ps.doc > text2ps.ps

I suspect they compiled it with the DJGPP compiler in the MSDOS directory of 
The Simtel archive.  That older version would have produced real real mode 
programs.  Up until Windows 7, that DOS version of text2ps would have worked 
under Windows command line.

The e2ps or a2ps  programs purport to do the same thing, incidentally.

At work (among lots of other things) I manage a whole mess of printers that 
churn out around 1.2 million prints a year for the enterprise.  I've been on a 
long term program to try to reduce printing as you might imagine.  What most 
people deal with every 4-5 years I see in some printers every few months.  The 
problem with laserprinters is it's like tires on your car - if you make a LOT 
of prints on the printer the rubber rollers wear out quickly, you can see the 
diameter get smaller.  If you make very few prints then the rubber rollers 
eventually age-harden and the paper starts slipping and you get a ton of jams 
on the printer

In the corporate arena we deal with the former and so use printer leasing 
companies who are constantly servicing the devices in the home area most home 
users deal with the latter.  The printer companies just laugh all the way to 
the bank.  There's no way you can run a printer without it wearing.  Paper 
fibers are abrasive, they actually used to sell paper that was used to polish 
the ends of fiberoptic fibers before gluing them into connectors until that was 
made obsolete with the invention of portable fusion splicers.

If you stick with buying printers that are designed as workgroup printers for 
use in the corporation you will be fine, your cost per page will not be 
significantly high.  It’s the printers designed for home users that are the 
expensive ones.  Micro-sized toner cartridges that run out after a ream, 
chipped so that you have to buy them from the manufacturer.  With bigger 
workgroup printers the aftermarket has solved that.  But ultimately the only 
solution is NOT to print.

Ted

-Original Message-
From: PLUG  On Behalf Of Keith Lofstrom

Sent: Wednesday, November 22, 2023 7:12 PM
To: plug@lists.pdxlinux.org
Subject: [PLUG] "text2ps.c" - 34 years of recompiling

Perhaps timewasting chatter, but the subject is a Unix/Linux program.  So there.

I've used Unix/Linux for almost 50 years now ... my first encounter was