[comp.text] HP DeskJet Plus DVI driver?

CCMK@latvax8.lat.oz (Mark Kosten - Computer Centre, La Trobe Uni.) (08/05/89)

Has anyone got an HP DeskJet Plus DVI driver (written in something
sensible so we can use it on different oeprating systems, eg
Unix, VAX/VMS, MS-DOS)?

I know the DeskJet was a lost cause due to memory and other
limitations, but the Plus version may be just the ticket
for cheap 300dpi output.

Thanks in advance,

Mark Kosten,			ISD:	+61 3 479-2767
Computer Centre,		ACSnet:	ccmk@latvax8.lat.oz
La Trobe University,
Bundoora,
Victoria 3083
Australia

rokicki@polya.Stanford.EDU (Tomas G. Rokicki) (08/09/89)

CCMK@latvax8.lat.oz (Mark Kosten - Computer Centre, La Trobe Uni.) writes:
> Has anyone got an HP DeskJet Plus DVI driver (written in something
> sensible so we can use it on different oeprating systems, eg
> Unix, VAX/VMS, MS-DOS)?

> I know the DeskJet was a lost cause due to memory and other
> limitations, but the Plus version may be just the ticket
> for cheap 300dpi output.

Time for my standard spiel on the DeskJet again.

The HP DeskJet is a wonderful printer for use with TeX.

If at all possible, get the DeskJet Plus---it is much much faster
(pages take under a minute rather than two to six minutes.)  Failing
this, get the landscape cartridge for the DeskJet.  I really don't
know more than this about the landscape cartridge; it's HP22707K.

The downloadable fonts for the printer are not really useful for TeX;
severe restrictions on size and placement preclude their (easy) use.
On the other hand, driving the printer as a bitmap engine turns out to
be moderately fast and convenient.

The AmigaTeX DeskJet driver is not available in source form, nor does
it run on other platforms.  On the other hand, the Nelson Beebe DVIJET
(not DVIJEP, which is for the LaserJet Plus) driver will work with
only a few modifications.

The DeskJet uses standard 300 dpi fonts (75, 100, and 150 dpi aren't
enough faster to ever really use.)  You want to use mode_def parameters
somewhat heavier than the imagen, but somewhat lighter than xerox.
(I use the imagen and get acceptable output, but sometimes the strokes
are a bit thin for my tastes.)

Please experiment with several different types of paper---and both
sides; the difference can be dramatic, especially if you are doing
graphics.

And here they are:

First, we'll talk about output efficiency.  The DeskJet allows you
to specify the graphics output width---it is recommended that you
scan the first 35 or so scanlines of your bitmap to find the
minimum width required, and set the width with this.  Then, send
all the bits until you hit a patch of vertical whitespace, or the
width is exceeded, or you've sent perhaps a half inch or so.  (You do
want to take advantage of the vertical whitespace and the narrow
equation areas.)

Now, we'll talk about actually building the page.  The following
comments are primarily directed at 640K PC's, but they are applicable
to any machine as well, since memory is time.
Some people have considered having a `virtual' bitmap with portions
swapped out to disk.  In my opinion, this is not the most efficient
way to do things.  Brutally pushing huge sections of bitmaps around
is not terribly efficient.  On the other hand, scanning a dvi page
takes almost zero time.  In addition, because you need to check to
make sure that characters and rules lie on the page anyway, you might
as well just do sections of a page at a time, and scan the dvi page
multiple times.  Scanning a dvi page six times takes under five
seconds on a typical PC XT; the page will take a minute (on a DeskJet
Plus) or two to six minutes (on a DeskJet) to print anyway.

But even this approach can lead to difficulties.  What if the user
uses cminch at three different sizes, and a bunch of other very
large characters?  You'll run out of memory to store the character
rasters.

And much of the typical TeX page is whitespace---margins at the top
and bottom, space between lines and equations---there's a lot of
potential memory savings.

This is what I do on the Amiga.  I allocate a `raster pointer array'
which has one pointer for each raster row---for 8 1/2 by 11 paper,
this array has 3300 elements at 300 dpi.  I initialize this array to
full NULLs at the beginning of each page.  I also initialize two
pointers to delimit the area I'm working with---I start with these
pointing to the full page (the first at the top of the page, and
the last at the bottom.)  Then I start reading the dvi file.

As I hit each font definition, I load in the font.  If I can't allocate
memory for the font, I call a `freemem' routine to free up some memory
until I can allocate memory.  (More on freemem later.)  And I continue.

As I hit each character or rule drawing command, I first make sure that
the character or rule lies at least partially within those two page
pointers, and is on the real page.  I then make sure there are
raster rows allocated for the section of the bitmap, and allocate them
as necessary.  If I can't get memory, I call the freemem routine until
I can, dynamically checking the bottom of the page bitmap (because
freemem might move it.)

As soon as I have the raster rows, I draw the character or rule, and
continue.

The freemem routine is only called if memory gets tight.  It is responsible
for freeing up at least one chunk of memory.  It does this by looking at
the page pointers---if they are within 1/10th of the page of each other,
it skips to the second portion of the freemem routine.  Otherwise, it
decrements the page bottom pointer until it hits a raster row with an
allocated row---it deallocates that row and returns.  (At any time if it
gets within 1/10th of a page of the top pointer, it skips to the second
part.)

The second part of the freemem routine deallocates fonts in an LRU manner.
(LRU---each time a font is `selected', an LRU counter is incremented and
assigned to a field in that font.  When we go to free a font, we find the
one with the smallest LRU value---and free that one.)  And we return after
freeing the font and marking it as unloaded.

On a 640K PC, most pages won't ever call freemem---there's plenty of memory
for the real page, the program, and whatever fonts are used.  And when
freemem is called, it's called in such a way that only two or three passes
are made over the .dvi file.  Only in degenerate cases like font tables is
freemem called to delete fonts---and then those fonts that need deleting
are deleted.  It all works very well.

Give it a shot!

donr@hpcvca.CV.HP.COM (Don Reid) (08/11/89)

I have modified one of the drivers from N. Beebe in Utah for the desk jet.

You can ftp the source from hpcvaaz.cv.hp.com as pub/dvidsk.tar.Z

It should be included in the next release from Utah.

/******************************
This is not HP software!  I have done this as a personal project (at home).
HP has no connection with this program.
******************************/


                                  Don Reid
                                  Hewlett Packard  Corvallis 
                                  donr@cv.hp.com
				  1020 NE Circle blvd. Corvallis, OR 97330

darrylo@hpnmdla.HP.COM (Darryl Okahata) (08/11/89)

In comp.text, rokicki@polya.Stanford.EDU (Tomas G. Rokicki) writes:

> CCMK@latvax8.lat.oz (Mark Kosten - Computer Centre, La Trobe Uni.) writes:
> > Has anyone got an HP DeskJet Plus DVI driver (written in something
> > sensible so we can use it on different oeprating systems, eg
> > Unix, VAX/VMS, MS-DOS)?
> 
> Time for my standard spiel on the DeskJet again.

     Wonderful, but where can these programs be found?  We've looked on
june.cs.washington.edu and labrea.stanford.edu, and we can't find any
dvi drivers, with the exception of an imagen driver.

     -- Darryl Okahata
	darrylo%hpnmd@hpcea.HP.COM

phil@delta.eecs.nwu.edu (Bill LeFebvre) (08/11/89)

In article <188@latvax8.lat.oz> CCMK@latvax8.lat.oz (Mark Kosten - Computer Centre, La Trobe Uni.) writes:
>I know the DeskJet was a lost cause due to memory and other
>limitations

Excuse me?  My Deskjet (NOT a plus) works just fine for producing TeX
output.  But then that may be because the guy that wrote the driver 
really knew what he was doing:  it's Rokicki's AmigaTeX driver (Hi Tom!).

But I am a little irked that HP came out with the plus about two months
AFTER I bought mine.  Grrrrrrr......

		William LeFebvre
		Department of Electrical Engineering and Computer Science
		Northwestern University
		<phil@eecs.nwu.edu>

phil@delta.eecs.nwu.edu (Bill LeFebvre) (08/11/89)

In article <11222@polya.Stanford.EDU> rokicki@polya.Stanford.EDU (Tomas G. Rokicki) writes:
>Please experiment with several different types of paper---and both
>sides; the difference can be dramatic, especially if you are doing
>graphics.

Does anyone (like you, Tom) have a good recommendation on paper to use
in a Deskjet?  I haven't had the chance to really experiment much, but
I would like to take advantage of other people's experiences.


		William LeFebvre
		Department of Electrical Engineering and Computer Science
		Northwestern University
		<phil@eecs.nwu.edu>

rusty@fe2o3.UUCP (Rusty Haddock) (08/12/89)

In article <1029@accuvax.nwu.edu> phil@delta.eecs.nwu.edu (Bill LeFebvre) writes:
   >In article <11222@polya.Stanford.EDU> rokicki@polya.Stanford.EDU (Tomas G. Rokicki) writes:
   >>Please experiment with several different types of paper---and both
   >>sides; the difference can be dramatic, especially if you are doing
   >>graphics.
   >
   >Does anyone (like you, Tom) have a good recommendation on paper to use
   >in a Deskjet?  I haven't had the chance to really experiment much, but
   >I would like to take advantage of other people's experiences.

I've been using some medium weight, 18-20-lb stock, in my DJ PLUS.  Seems
to work well.  I do need to try some LASER printer or copier paper to see
how well it works.  Two things:

	o  Supposedly, you're s'pose to print on the side with the water
	   mark but I haven't seen any differences yet.

	o  On using Xerographic paper, there is a right and wrong side which
	   can not be seen.  There should be an arrow on the side of the paper
	   wrapper that points to the `good' side.  [This is according to the
	   Owner's Manual with my DJ PLUS.]

I, quite honestly, haven't seen a difference on the stock that I'm using.

			-Rusty-
-- 
Rusty Haddock		o  {uunet,att,rutgers}!mimsy.umd.edu!fe2o3!rusty
Laurel, Maryland	o  "IBM sucks silicon!" -- PC Banana Jr, "Bloom County"