
! script name: draft.d/usercharseq
! topic: make font characters

!A
!A NAME:
!A
!A 	Make User Character Sequence.
!A
!A DESCRIPTION:
!A
!A 	This script allows the user to make their own font characters.
!A 	The characters should be made within a one inch square.
!A 	Characters are stored on layers corresponding to ascii numbers.
!A 	This script will replace any font character with the geometry
!A 	drawn on the corresponding layer.
!A 	The font must be stored for the change to be permanent.
!A
!B INSTRUCTIONS:
!B
!B 	FONT NUMBER ( 1 ) ( 2 ) ( 3 ): Enter the font number to be used for
!B 		calling out the characters created.
!B
!B WARNING: This script can permanently modify the system.
!B
!B 	To modify a font the following procedure should be followed.
!B
!B 		1: Select New file. Select Inch Programming.
!B 		2: Execute the script draft.d/explodefont - this explodes the
!B 		   font geometry onto layers corresponding to ascii numbers.
!B 		3: Modify the geometry for characters on the appropriate layers.
!B 		4: Execute the script draft.d/usercharseq - this sets the
!B 		   characters.
!B 		5: Execute the script draft.d/storefont	- this stores the font.
!B 		6: Check what you have done.
!B
!B 	Only experienced users should try this procedure.
!B
!B 	ANY QUESTIONS call customer service.
!B
!# see also - help.d/fonts.hlp


stat=ChangeLabelStr("ScriptNameStatus","Function: make user seq ")

DIM Destination$[256]
DIM Answer$[256]
DIM Fontfile$[256]

DEG

Fontnum=1

Stat=SetInputFormat("n0=","")
Stat= SetEqualsValue(fontnum)
Fontnum=GetValue("FONT NUMBER ( 1 ) ( 2 ) ( 3 )",Answer$)
IF (ExitScript(Destination$)) THEN Leave

Stat=SetInputFormat("a1=",",Y,")
Stat= SetEqualsValue(0,"Y")
Stat=GetValue("MODIFY FONT #"&VAL$(Fontnum)&"  Y or N ",Answer$)
IF (ExitScript(Destination$)) THEN Leave
IF Answer$= "N" THEN Leave

FOR I= 1 TO 255
	Group= GrpByLayer(I)
	IF ValidGeometry(Group) THEN
		N1= GroupCount(Group)
		IF N1 > 0 THEN
			Stat= MakeUserChar(Group,I,fontnum)
		END IF
		Stat= DeleteEntity(Group)
	END IF
NEXT I


Stat=SetInputFormat("a1=",",Y,")
Stat= SetEqualsValue(0,"Y")
Stat=GetValue("STORE FONT FILE IN USER DIR  Y or N ",Answer$)
IF (ExitScript(Destination$)) THEN Leave
IF Answer$= "N" THEN Leave

fontfile$= "synergy.font"
SELECT fontnum
CASE 0
CASE 1
        fontfile$= "synergy.font"
CASE 2
        fontfile$= "synergy.font1"
CASE 3
        fontfile$= "synergy.font2"
CASE 4
        fontfile$= "symbols.font"
CASE 5
        fontfile$= "symbols.font1"
CASE 6
        fontfile$= "symbols.font2"
CASE ELSE
        fontfile$= "synergy.font"&VAL$(I)
END SELECT
stat= StoreFont(Fontfile$,fontnum)

Stat=SetInputFormat("a1=",",Y,N,")
Stat= SetEqualsValue(0,"N")
Stat=GetValue("UPDATE /usr/weber/bin/   Yes or No ",Answer$)
IF (ExitScript(Destination$)) THEN Leave
IF Answer$= "Y" THEN
        Fontfile$=FileNameString("/usr/weber/bin",Fontfile$)
        stat= StoreFont(Fontfile$,fontnum)
END IF

Leave:!
stat= SetInputFormat("n4","")
Stat=DeleteEntity(Group)
IF (NOT LEN(Destination$)) THEN
	 LOAD "typecontrol"
ELSE
	 LOAD Destination$
END IF
END
