

     I.C.D.  INTERACTIVE CHARACTER DESIGN
     ------------------------------------

     Alan Wylie 26/10/79
     -------------------

     Copyright Laserscan Laboratories Limited,Cambridge,England
     ----------------------------------------------------------

Characters (or primaries - all the same now) can be 0-150 in ICD2. WJJ 22-Jun-88


I.C.D enables an operator interactively to design a character set using the
refresh capabilities of the High Resolution Display.The characters may include
primaries,and character sets can be stored on and recalled from disc. The
characters are made up of "moveby"s and "drawby"s.These are stored in the
INTEGER array STORE(3,MAXPNT), and are referred to by the array CHREF(3,MAXCHR).
The first element of STORE contains the X displacement, the second the Y
displacement and the third has bit 1 set for a line and clear for a move, and
bit 3 set if it is a call to a primary, in which case the number of the primary
is in the first element of STORE. The first element of CHREF points to the
address in STORE at which the character starts,and the second contains the
number of points in the character. The next free location in STORE is kept in
STRTOP,and the current character in CHAR. 

The program is controlled by the tracker ball,the 16 function buttons, and text
input from the console.The function buttons act as follows: 



---------------------------------------------------------------------
!                !                !                !                !
!    Add move    !    Add draw    !   Delete last  !                !
!                !                !                !                !
!     to end     !     to end     !  point in list !                !
---------------------------------------------------------------------
!Create character! Edit character !                !                !
!                !                !                !                !
!   (Prompt on)  !   (Prompt on)  !   Move point   !  Delete point  !
!   (keyboard )  !   (keyboard )  !                !                !
---------------------------------------------------------------------
!                !                !                !                !
!                !                !                !    Prompt on   !
!    Make move   !    Make draw   !    Add point   !                !
!                !                !                !    keyboard    !
---------------------------------------------------------------------
!                !                !     Flip       !                !
!                !     Flip       !                !                !
! Recall primary !                !   "move rest   !                !
!                !"line to cursor"!  of character" !                !
---------------------------------------------------------------------


FB1:	Adds the point at which the cursor is positioned to the
	present character as a move.

FB2:	Adds a point as a draw.

FB3:	Removes the last point in the present character.

FB5:	Causes a prompt on the console asking for the number of the
	next character to be created.

FB6:	Asks for the next character to be edited.

FB7:	Attaches the point over which the cursor is positioned
	to the cursor,enabling the point to be moved.

FB8:	Deletes the point over which the cursor is positioned.

FB9:	Makes the point over which the cursor is positioned a "moveto"

FB10:	Makes this point a "drawto".

FB11:	Creates another point at the point over which the cursor is
	positioned,and attaches it to the cursor.

FB12:	Causes the prompt ICD> to be displayed on the console,so that
	a command can be typed in.

FB13:	Asks for the number of a primary,and recalls it and attaches
	it to the cursor,until the button is pressed again,or FB16 is
	pressed,which returns to the previous state.

FB14:	Turns line to cursor alternately on and off.

FB15:	Alternate presses mean that in "move" mode (FB7 and FB11), the remaining
	points move with the one being moved


COMMANDS:
---------

RECall:	Asks for a file name,opens that file,and reads its contents
	into STORE and CHREF.

SAVe:	Saves STORE and CHREF in a file as above.

QUIt:	Exits from the program.

CLEar:	Clears all points in the current character

GRId:	Draws a grid on the photochromic

DCPc:	Draw Character on PhotoChromic film

DAPc:	Draw All characters on PhotoChromic film

DADi:	Draw All characters on DIazo


The program consists of:
	main		ICD
	subroutines	DRAW
			DRWGRD
			CLIP
			FINDPT
			GARBAG
	common block	CHRSTR


ICD
---

This is the main loop of the program,containing the setting up,and a
goto list,indexed by the function buttons.


DRAW(CHAR)
----------

This subroutine draws in refresh or stored mode the character CHAR,stored in
STORE, and referred to by CHREF(1,CHAR),and CHREF(2,CHAR), and also calculates
the maximum displacement of the points in the character.


DRWGRD
------

DRWGRD draws a grid on the photochromic film.


CLIP(X,Y,IPOSX,IPOSY,CPOSX,CPOSY,CSTRX,CSTRY)
-----------------------------------------------

This is called after a function button interrupt caused by the tracker
ball.The position of the cursor in machine units is passed in X and Y.
The quantised position is returned in my coordinates in IPOSX,IPOSY,and
in machine coordinates in CPOSX,CPOSY.The old cursor position is kept
in CSTRX,CSTRY.The position of the cursor is also clipped to the area
of the grid. 


FINDPT(I,CHAR,IPOSX,IPOSY)
--------------------------

Returns in I the position in STORE of the first point in character CHAR
with coordinates IPOSX,IPOSY.If there is no such position,I is set to
0. 


GARBAG(STRTOP)
--------------

Tidies up STORE so that the characters are stored in ascending
numerical order,with no deleted points. 

CHRSTR
------

This contains the arrays STORE and CHREF.



