[comp.sys.mac] Thin lines from the LaserWriter

matthews@endor.harvard.edu (Jim Matthews) (12/30/86)

I would like to be able to print thin (1 pixel thick) lines on the LaserWriter
from an application I have developed.  The application graphs math functions
to the screen, and I recently added the capability to print the graphs.  The
printing code is straight out of Inside Mac -- I just open a printing grafport
and draw the picture.  On an ImageWriter the printing looks great, but on
the LaserWriter it isn't up to the capabilities of the printer.  The lines
of the graph, which are generated with simple LineTos and FramePolys, are
thickened to match the fourfold improvement in printer resolution.  What I
would like, however, is for it to print the thinest lines possible, since
they represent abstract lines in space and not actual objects with thickness.

Is there a way to specify how the LaserWriter handles lines, either with
general printing code or code that is specific to PostScript printers?  Any
help or pointers would be greatly appreciated.

Jim Matthews
matthews@harvard

thomas@utah-gr.UUCP (Spencer W. Thomas) (12/31/86)

If you specify a width of zero for lines in PostScript, it will print as
the thinnest line possible on the output device.  Exactly how you get
this through the LW driver, I leave to you.

(Note that this will give practically invisible lines on a higher
resolution typesetter, so it's not a good general solution.)

-- 
=Spencer   ({ihnp4,decvax}!utah-cs!thomas, thomas@cs.utah.edu)

spector@acf4.UUCP (David HM Spector) (12/31/86)

An elegant solution to this may be to use quickdraw picture comments.  With
piccomments, you can put postscript directly into the LaserWriter.  This will
buy you complete control over the printer.  If you examin the prinfo record that
the print manager fills out for you when using a laserwriter, the print manager
likes to believe that the laserwriter is a 72dpi device, using raw/real Post-
Script will allow you to get around this.  I believe that tn91 deals with 
picture comments.

David Spector
NYU/acf Systems Group

dwb@well.UUCP (David W. Berry) (01/01/87)

The easies way I can think of is to compile the graph into a picture
using an offscreen bitmap and a bounds that is four times (on a side
as large as your normal printing area.  Then print the picture to the
laserwriter with a page size rectangle.  Ie.

	AllocateBitMap(&bitmap, 0, 0, PAGEWIDE * 4, PAGELEN * 4);
	OpenPort(&offscreen);
	SetPortBits(&bitmap);
	pict = OpenPicture(&bitmap.bounds);
	MoveTo(45, 45);
	LineTo(300, 300);
	ClosePicture();

	PrOpenPage(...);
	SetRect(&rect, 0, 0, PAGEWIDE, PAGELEN);
	DrawPicture(pict, &rect);
	PrClosePage(...);

Hope this helps,


	
-- 
	David W. Berry
	dwb@well.uucp                   dwb@Delphi
	dwb@GEnie                       293-0752@408.MaBell