
! script name: draft.d/explodefont
! topic: explode font character shapes

!A
!A NAME:
!A
!A 	Explode Font
!A
!A DESCRIPTION:
!A
!A 	This script explodes a font with each character in a 1 inch square
!A 	put on a layer corresponding to its ascii number.
!A
!B INSTRUCTIONS:
!B
!B 	This script is to be used when creating new fonts.
!B
!B 	WARNING: Only use this script after executing a New file. Inch Mode.
!B
!B 	To modify a font the following procedure should be followed.
!B
!B 		1: Select New file.
!B 		2: Execute the script draft.d/explodefont - this explodes the font
!B 		   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 - 
!B			this sets the 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 	ANY QUESTIONS call customer service.
!B
!# see also - help.d/fonts.hlp

stat=ChangeLabelStr("ScriptNameStatus","Function: explode font ")

DIM Answer$[256]
DIM Destination$[256]
DEG

DeActivateUndo
Text_loop:!

fontnum=1

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

Fontr= GetDefault(WsTextFont)
Widthr= GetDefault(WsTextWidth)
Heightr= GetDefault(WsTextHeight)
Angler= GetDefault(WsTextAngle)

Stat=SetDefaults(WsTextHeight,1.0)
Stat=SetDefaults(WsTextWidth,1.0)
Stat=SetDefaults(WsTextFont,Fontnum)
Stat=SetDefaults(WsTextAngle,0.0)

Pc= PointXYZ(0,0,0)

FOR Number= 1 TO 255
	Stat= SetCurrentLayer(Number)
	T1=TextLine(Pc,CHR$(Number))
	Grp1= ExplodeText(T1)
	Stat=DeleteEntity(T1)
	Stat=DeleteEntity(Grp1)
NEXT Number
Stat=DeleteEntity(Pc)
Stat=SetDefaults(WsTextHeight,Heightr)
Stat=SetDefaults(WsTextWidth,Widthr)
Stat=SetDefaults(WsTextFont,Fontr)
Stat=SetDefaults(WsTextAngle,Angler)

Leave:!
Stat= SetCurrentLayer(0)
Stat=SetInputFormat("n4","")
Stat=DeleteEntity(Pc)
Stat=DeleteEntity(T1)
Stat=DeleteEntity(Grp1)
IF (NOT LEN(Destination$)) THEN
	 LOAD "typecontrol"
ELSE
	 LOAD Destination$
END IF
END
