[comp.sys.next] How the NeXT printer system works

rlin@cs.ubc.ca (Robert Lin) (10/08/90)

When you print with NeXT, the system software first determines if your
printer is a NeXT laser, or a "Apple LaserWriter". If the former, it
will proceed to rasterize the postscript image in memory (usually causing
massive amounts of swapping, especially with 8M RAM and at 400 dpi),
then once the page is rasterized, pump it at high speed through the
special NeXT printer port.

The NeXT printer port is interesting in more ways than one. It's the only
non-standard connector (if you discount the monitor, which is about as
queer as a three dollar bill). It's also got its own clock output, which
means you can speed up the printinig speed if:

1. The printer is receptive to higher speed, and
2. The motherboard is willing to up the clock signal

This brings up one interesting point for speculation. Obviously you don't
need to pump data out any faster than the print engine can process a page.
At 8 pages per minute, assuming 400 dpi and a 8.25 X 10.75 inches printable
area, one page takes a maximum of 14,190,000 dots, or 1,773,750 bytes in tightly
packaged stream. 

So if we can feed the printer at a rate equal to 1,773,750 bytes X 8 =
13,857K per minute, the printer will be kept fully busy. Assuming that it
takes a typical 30 seconds to rasterize each page, (varies greatly due
to different complexity of page layout), we'll never miss a beat if we
pump out data at the rate of 13,857K per (minute + 8 X 30 seconds = 5
minutes) or 46.19K per second.*

*NOTE: assuming we can simultaneously send last rasterized page and
perform next page rasterization, which in practice probably doesn't happen
as it consumes too much memory and drags the system to its heels.

Well, anyways, if ever sound the resolution changes (say 1200 dpi), or
if color becomes implemented (3 - 24 bits instead of 1 bit per pixel,
or 3 to 24 times increase of data density) we'd obviously need to speed
up the interface. Then we make the motherboard output a higher clock rate
and make the print engine able to accept high speed stream. An elegant
design.

The second possibility, if we are printing to a Postscript device like a
LaserWriter, the system software will pass the stream directly to the
laser, instead of rasterizing internally. 

Since the interface is invariably serial, the old system 1.0 had a great
difficulty: it only works reliably at 9600 bps. At 19200, the software
flow control tends to screw up badly under load. Anyways, that's been fixed
in system 2.0 (or so I am assured), and it may be possibly to transmit
data stream at up to 38,400 bps (assuming your printer can keep up).

Well, enough hand waving. If you have a fast Postscript laser, like my
Qume CrystalPrint Publisher (using RISC processor for Postscript), at
38,400 bps it is likely to almost always outrun a Next laser for anything
except a big bitmap.

The next laser always wins big on printing bitmaps (faxes, TIFF files, etc)

While you get more versatility with a postscript printer, as it can be
shared by Macs and PCs and other workstations, you get the advantage of
"infinite font set" with Next laser. As long as you have a screen font,
you can print it. My Qume is not strictly Postscript compatible; i.e. it
doesn't read adobe fonts, so it loses out on font compatibility.

So how do you support another printer that is neither NeXT nor postscript?
In another word, how does iwscript work? (Iwscript is a program I wrote,
available on ftp archives, that lets you print to an Apple Image Writer
in full graphics) You take the Postscript stream destined for a Postscript
laser, intercept it and rasterize it in memory. Then you take the bitmap
and dump it to the printer.

So theoretically, any printer that does graphics can be supported. In
practice, unless your printer has a SCSI or ethernet connector, the band
width of the serial port can only support low resolution devices, otherwise
you'd wait forever for print outs.

-Robert Lin <rlin@cs.ubc.ca>