drawer1.0

a NeWS server resident drawing editor
-------------------------------------
copyright 1988 David A. LaVallee and Sun Microsystems, Inc.

This is a PRELIMINARY look at drawer, it needs to be cleanly rewritten.

Currently it is 632 lines of sloppy NeWS language (server) code.

INTRODUCTION
############

Drawer 1.0 has:

	-lines and splines under a "point-adjust" scheme.
	-grid snap granularity from 1 to 200 points
	-cyan, yellow, magenta, black color specification (for
	 possible process seperation)
	-Laserwriter fonts, left right and center justification
	-Use of any rasterfile as a "template" to trace.
	-outputs a LaserWriter printable file

it doesn't have:

	-any undo facility
	-any selection to support copy, move or delete functions
	-support for rotation, sheering, or scaling
	-zoom and pan

But it ain't no shame to get what its got in 600 lines of NeWS-PostScript
code.

INSTALLATION
############

I'm afraid this is pretty deterministic at this point, I've run drawer on
my Sun3/110 (see CAVEATS), and a Sun3/50. Drawer is a NeWS language program
that needs to get loaded into the NeWS server you are sitting at. The psh
program will do this nicely: psh drawer.

Drawer relies on a few file names being present in your server environment.

new	allows the word new to be entered at the File: prompt to have a blank
	background

info	Author information (that's me) I don't mind you changing this file
	you may not want to see the sun logo, the file gets loaded when
	drawer starts up. (please leave the credit and copyright info in).

help	is a breif prompt to get people started, I hope to have all instructions
	in a hypermedia environment for drawer2.0.

All of these files may be substituted by this command:

	touch /usr/NeWS/lib/new
	touch /usr/NeWS/lib/info
	touch /usr/NeWS/lib/help

The BIGGEST BUG for now is that drawer wants the screen to run retained!!!!!!
If the screen ain't retained drawer won't be your friend. This is easy to 
remedy and I hope it will be fixiepoo by UNIFORUM.

INSTRUCTIONS
############

STARTING OUT
************

psh drawer	-load drawer into your NeWS server (15-25 seconds load time)

Drawer has 3 "pages" that do specific things, you flip between them depending
on what you are doing. You start on the "controls" page (and may return to it
at any time by invoking the "controls" option on the pop-up menu). The controls
allow for:

>>> Setting the File: value

	click the mouse on the File: box and type with the keyboard.
	All filenames and paths MUST BE direct (no *, ?, or ~ escapes)

>>> Setting the font and text characteristics:

	click Font: to rotate through the available fonts
	click Align: to rotate through alignment options
	click Points: to rotate through point sizes

	The results of these clicks is displayed in the box above the
	clickable items and reflects the current settings.

>>> setting color values

	you can set color values for the "fill, stroke, and fill&stroke"
	pop-up menu items with the cyan, yellow, magenta, and black sliders,
	and the "line" and "fill" buttons. The current text color is the same
	as the current line color (as seen in the box labeled "drawer1.o")	

	just drag the sliders to changethe current values.

	click "line" or "fill" buttons to change the effect of the sliders

>>> setting line stroking width

	user the linewidth slider to change the width of stroked lines.

>>> Grid Snap

	This was fun (~12 lines of code).

	the "Grid Snap:" slider sets the current snap value in the
	CTM space of drawer.

	this makes it VERY easy to draw boxes, grids, repetetive spline
	designs. I'll leave it to you to suggest other uses for snap.

>>> FILE PRE_VIEW BUTTON

	There is a button at the top left of the control page that reflects
	the contents of the preview page.

	It is an active area of the screen and will flip you quickly to the
	preview page if you are working on a drawing.

	It does other magic too, if the filename entered at the "File:"
	prompt is CHANGED from the lasttime you hit the preview button
	then drawer will ATTEMPT to read the file named and render it under
	your current drawing marks. This is VERY useful to annotate other
	PostScript (single page only PLEEEEZE) (TM) documents.

	You could fo example, setup a troff page with some space in an
	area, then PostScript the troff file with the Transcript function
	
		ptroff [-flags] -t > myfile

	and then load myfile into drawer and draw a picture in the white space
	you left with troff. after you write the drawer file you can print
	the result by editing the troff postscript file and inserting the
	drawer file at the end (I haven't tried this yet, it should work).

The Preview page

	when you are on the preview page (it starts out white) you can see
	what the result will be of all of your drawing.

	The point button on your mouse (left button on Sun) will drop you into
	the blueprint page.

	The adjust button on your mouse (right button on Sun) will jump back to
	the control page.

	Whenever you hit the preview button on the control page or execute
	a renrering command (stroke, fill, fill&stroke or a <CR> to show
	text) the preview page will pop to top and render all of the drawing
	marks.

The blueprint page

	This is wher you draw, it is where the template image (if any is
	used) appears for tracing.

	there is a SIMPLE and SPEEDY mouse dialog for drawing things. The
	dialog uses all three mouse buttons (I could easily get by with
	two, but one would be potential disaster).

	PointButton (Left on Sun)
		click to establishes a pendown point if none exists
		click and drag to draw a straight line from the last
		 pen position.

	AdjustButton (Middle on Sun)
		rotates through 3 functions on the current line segment

		1-click&drag pulls a single bspline control point
		2-click&drag pulls a second bspline control point
		3-click&drag pulls the end of the line segment

		You may rotate throught these functions to adjust the current
		 line as required.

	The KEYBOARD

		You may enter text in the blueprint page by establishing
		a current point (if lines are pending you will have to
		consume them with stroke, fill, etc.) with the point button.

		Then you may type your string and end it with a carriage return
		**** there is no rub-out currently ******

*******************
To SAVE YOUR WORK
#################

	enter a file name at the "File:" prompt on the control page and select
	the "write File:" command from the pop-up menu. remember to add
	a showpage if you intend to print the file alone. You can review
	your output with the psview program in NeWS.

CAVEATS
#######

1. Be sure you are running retained (is default in black and white, an option
in the User Interface menu in color).

2. drawer loves memory!!!! I run 8Mb in my 3/110. A 4Mb color machine may
be unhappy puppy.

3. drawer will FAIL TO START (die in the vernacular) if the file "info" is
not present in your environment!!!!!!!!!!!!!!!!!!

4. when you write a file you will have to add a showpage command to the
end of the file to make it print out a PostScript (TM) printer. This will do
it:

	echo "showpage">>myfile

where myfile is whatever you called your file when you wrote it to disk.

5. The CYMB sliders SHOULD update to whaever their values ARE when you go
between "line" and "fill" color setting functions, it doesn't.

6. reading in a template file is TRICKY!!!!!!!

	1. enter the name of a file (readable by readcanvas) at the File: prompt
		/usr/NeWS/smi/founders.im8

	2. invoke Template Image from the pop-up menu

	3. drawer flips to the "blueprint" page and waits for you to
	layout a rectangle for the image to fill.

	YOU MUST LAYOUT THE RECTANGLE FROM LOWER LEFT TO UPPER RIGHT
	this is a bug that I will try to fix soonly!

	4. You MAY reselect the Template Image from the pop-up menu if you
	don't like the layout of the image

	5.you MAY "zoom" on the image by laying out the rectangle larger than
	the drawer window (go ahead try it.)

	6. REMEMBER TO CHANGE THE FILE at the File: prompt back to what it was
	so drawer doesn't try to execute the rasterfile as a NeWS program.
	(this warning is nondestructive, your drawing won't be trashed, it's
	just a pain in the butt to wait for drawer to figure out that there
	is a problem).

SUMMARY
########

Drawer was written by David LaVallee at Sun Microsystems, Inc. to do
presentation graphics and picture development for other NeWS applications.

Drawer took about 80 hours of development (3 generations of the program) to
end up with 630 sloppy lines of code. For what drawer is currently it 
is possible to reduce the code size by way of cleanup, down to ~450 lines.

If you have work you would like to share with the author or suggestions
to make drawer better, email sun!jamboree!drawer


