From:	CSBVAX::MRGATE!RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP 25-OCT-1988 06:33
To:	ARISIA::EVERHART
Subj:	Font Program For VT2xx


Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Tue, 25 OCT 88 02:02:13 PDT
Received: from ucbvax.Berkeley.EDU by KL.SRI.COM with TCP; Tue, 25 Oct 88 01:38:11 PDT
Received: by ucbvax.Berkeley.EDU (5.59/1.31)
	id AA25305; Tue, 25 Oct 88 01:01:39 PDT
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 24 Oct 88 02:58:12 GMT
From: munnari!otc!metro!basser!usage!patrick@uunet.uu.net  (Patrick Young)
Organization: Computing Services Dept, UNSW, Australia
Subject: Font Program For VT2xx
Message-Id: <193@usage.csd.unsw.oz>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

This is FONT.BAS, A program to enable you to create, and edit your own
fonts for VT200 series terminals. It was written using VAX BASIC V3.2.

$!.............................................................................
$! VAX/VMS archive file created by VMS_SHARE V06.00 26-May-1988.
$!
$! VMS_SHARE was written by James Gray (Gray:OSBUSouth@Xerox.COM) from
$! VMS_SHAR by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au).
$!
$! To unpack, simply save, concatinate all parts into one file and
$! execute (@) that file.
$!
$! This archive was created by user PATRICK
$! on  6-APR-1866 20:07:23.77.
$!
$! It contains the following 1 file:
$!        FONT.BAS
$!
$!==============================================================================
$ SET SYMBOL/SCOPE=( NOLOCAL, NOGLOBAL )
$ VERSION = F$GETSYI( "VERSION" )
$ IF VERSION .GES "V4.4" THEN GOTO VERSION_OK
$ WRITE SYS$OUTPUT "You are running VMS ''VERSION'; ", -
    "VMS_SHARE V06.00 26-May-1988 requires VMS V4.4 or higher."
$ EXIT 44 
$VERSION_OK:
$ GOTO START
$
$UNPACK_FILE:
$ WRITE SYS$OUTPUT "Creating ''FILE_IS'"
$ DEFINE/USER_MODE SYS$OUTPUT NL:
$ EDIT/TPU/COMMAND=SYS$INPUT/NODISPLAY/OUTPUT='FILE_IS'/NOSECTION -
    VMS_SHARE_DUMMY.DUMMY
b_part := CREATE_BUFFER( "{Part}", GET_INFO( COMMAND_LINE, "file_name" ) )
; s_file_spec := GET_INFO( COMMAND_LINE, "output_file" ); SET( OUTPUT_FILE
, b_part, s_file_spec ); b_errors := CREATE_BUFFER( "{Errors}" ); i_errors 
:= 0; pat_beg_1 := ANCHOR & "-+-+-+ Beginning"; pat_beg_2 := LINE_BEGIN 
& "+-+-+-+ Beginning"; pat_end := ANCHOR & "+-+-+-+-+ End"; POSITION
( BEGINNING_OF( b_part ) ); i_append_line := 0; LOOP EXITIF MARK( NONE 
) = END_OF( b_part ); s_x := ERASE_CHARACTER( 1 ); IF s_x = "+" THEN r_skip 
:= SEARCH( pat_beg_1, FORWARD, EXACT ); IF r_skip <> 0 THEN s_x := ""
; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ERASE_LINE; ENDIF; ENDIF
; IF s_x = "-" THEN r_skip := SEARCH( pat_end, FORWARD, EXACT ); IF r_skip <
> 0 THEN s_x := ""; MOVE_HORIZONTAL( -CURRENT_OFFSET ); m_skip := MARK( NONE )
; r_skip := SEARCH( pat_beg_2, FORWARD, EXACT ); IF r_skip <> 0 THEN POSITION
( END_OF( r_skip ) ); MOVE_HORIZONTAL( -CURRENT_OFFSET ); MOVE_VERTICAL( 1 )
; MOVE_HORIZONTAL( -1 ); ELSE POSITION( END_OF( b_part ) ); ENDIF; ERASE
( CREATE_RANGE( m_skip, MARK( NONE ), NONE ) ); ENDIF; ENDIF
; IF s_x = "V" THEN s_x := ""; IF i_append_line <> 0 THEN APPEND_LINE
; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ENDIF; i_append_line := 1; MOVE_VERTICAL
( 1 ); ENDIF; IF s_x = "X" THEN s_x := ""; IF i_append_line <
> 0 THEN APPEND_LINE; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ENDIF
; i_append_line := 0; MOVE_VERTICAL( 1 ); ENDIF; IF s_x <> "" THEN i_errors 
:= i_errors + 1; s_text := CURRENT_LINE; POSITION( b_errors ); COPY_TEXT
( "The following line could not be unpacked properly:" ); SPLIT_LINE
; COPY_TEXT( s_x ); COPY_TEXT( s_text ); POSITION( b_part ); MOVE_VERTICAL( 1 
); ENDIF; ENDLOOP; POSITION( BEGINNING_OF( b_part ) ); LOOP r_x := SEARCH( "`"
, FORWARD, EXACT ); EXITIF r_x = 0; POSITION( r_x ); ERASE_CHARACTER( 1 )
; IF CURRENT_CHARACTER = "`" THEN MOVE_HORIZONTAL( 1 ); ELSE COPY_TEXT( ASCII
( INT( ERASE_CHARACTER( 3 ) ) ) ); ENDIF; ENDLOOP; IF i_errors = 0 THEN SET
( NO_WRITE, b_errors, ON ); ELSE POSITION( BEGINNING_OF( b_errors ) )
; COPY_TEXT( FAO( "The following !UL errors were detected while unpacking !AS"
, i_errors, s_file_spec ) ); SPLIT_LINE; SET( OUTPUT_FILE, b_errors
, "SYS$COMMAND" ); ENDIF; EXIT; 
$ DELETE VMS_SHARE_DUMMY.DUMMY;*
$ CHECKSUM 'FILE_IS
$ WRITE SYS$OUTPUT " CHECKSUM ", -
  F$ELEMENT( CHECKSUM_IS .EQ. CHECKSUM$CHECKSUM, ",", "failed!,passed." )
$ RETURN
$
$START:
$ FILE_IS = "FONT.BAS"
$ CHECKSUM_IS = 1970500414
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X10`009Rem`009*******************************
X`009`009*                             *
X`009`009*  Font Creation Program For  *
X`009`009*           VT2xx             *
X`009`009*    Sep 1988 R. P. Young     *
X`009`009*        Version 1.0          *
X`009`009*                             *
X`009`009*******************************
X
X20`009Let`009CLS$ = Chr$(27) + "[;1H" + Chr$(27) + "[;1J"
X`009Let`009INV$ = Chr$(27) + "[7m"
X`009Let`009NOR$ = Chr$(27) + "[0m"
X`009Let`009BOL$ = Chr$(27) + "[1m"
X   `009Let`009STC$ = Chr$(27) + "["
X`009Let`009WTE$=CLS$+STC$+"12;37H"+INV$+BOL$+" WAIT "+NOR$
X`009Dim`009FONT%(94,10,8)
X`009Print`009Chr$(27);"(1"
X
X30`009For`009CHAR = 1 To 94
X`009For`009ROW = 1 To 10
X`009For`009COL = 1 to 8
X`009Let`009FONT%(CHAR, ROW, COL) = 0
X`009Next`009COL
X`009Next`009ROW
X`009Next`009CHAR
X
X40`009Print`009CLS$;INV$;BOL$;"Font Editor/Creator Program:";NOR$
X`009Print`009STC$;Str$(7);";";Str$(17);"H";
X`009Print`009INV$;   "                 Main Options:                  ";NOR$
X`009Print`009Tab(16);"Exit Program ................................. 1"
X`009Print`009Tab(16);"Clear Workspace .............................. 2"
X`009Print`009Tab(16);"Create/Edit Font ............................. 3"
X`009Print`009Tab(16);"Load A Font .................................. 4"
X`009Print`009Tab(16);"View The Font ................................ 5"
X`009Print`009Tab(16);"Create Output Text ........................... 6"
X`009Print`009Tab(16);INV$;
X`009Print`009"                 Your Choice :                 ";NOR$;
X`009Let`009OPT = 0
X`009While`009(OPT < 49 Or OPT > 54)
X`009Let`009OPT = Asc(Inkey$(0%, Wait))
X`009Next
X`009On`009Error Goto 60
X`009On`009(OPT - 48) Goto 70,80,90,120,130,140
X
X50`009Stop
X
X60`009Print`009CLS$;INV$;BOL$;"File Error On I/O:";NOR$
X`009Print`009STC$;Str$(9);";";Str$(0);"H"
X`009Print`009Tab(30);"Error Occoured On File I/O"
X`009Print
X`009Print
X`009Print`009Tab(30);"Press Any Key To Continue.";
X`009Let`009ANS$ = Inkey$(0%, Wait)
X`009Resume`00940
X
X70`009Print`009CLS$;INV$;BOL$;"Exit Program Option:";NOR$
X`009Print`009STC$;Str$(10);";";Str$(0);"H";
X`009Print`009"Save workspace before exiting [Default (Y)es] : ";
X`009Let`009ANS$ = Inkey$(0%, Wait)
X`009If`009(ANS$<>"N" And ANS$<>"n") Then
X`009Print`009"Yes";STC$;Str$(14);";";Str$(0);"H";
X`009Input`009"Full File Name For Workspace                  ";FILE$
X`009Print`009WTE$;
X`009Open`009FILE$ For Output As File #1, Recordsize 80
X`009For`009CHAR = 1 To 94
X`009For`009ROW = 1 To 10
X`009For`009COL = 1 to 8
X`009Print`009#1, Str$(FONT%(CHAR, ROW, COL)) ;
X`009Next`009COL
X`009Next`009ROW
X`009Print`009#1
X`009Next`009CHAR
X`009Close`009#1
X`009End`009If
X`009Print`009CLS$
X`009Goto`009150
X
X80`009Print`009CLS$;INV$;BOL$;"Clear Workspace Option:";NOR$
X`009Print`009STC$;Str$(10);";";Str$(0);"H";
X`009Print`009"Are You Sure [Default (Y)es] : ";
X`009Let`009ANS$ = Inkey$(0%, Wait)
X`009If`009(ANS$<>"N" And ANS$<>"n") Then
X`009Print`009WTE$
X`009Goto`00930
X`009End`009If
X`009Goto`00940
X
X90`009Print`009CLS$;INV$;BOL$;"Create/Edit Font Option:";NOR$
X`009Print`009STC$;Str$(10);";";Str$(0);"H";
X`009Print`009"Type The Character You Want To Edit : ";
X`009Let`009ANS = 0
X`009While`009(ANS < 1 Or ANS > 94)
X`009Let`009ANS = Asc(Inkey$(0%, Wait)) - 32
X`009Next
X`009Print`009CLS$;INV$;BOL$;"Create/Edit Font Option:";NOR$
X`009Print`009STC$;Str$(4);";";Str$(33);"HEditing Char : ";Chr$(ANS + 32)
X
X100`009Print`009STC$;Str$(7);";";Str$(0);"H";
X`009Print`009Tab(33);BOL$;" 1  2  3  4  5  6  7  8 ";NOR$;Chr$(27);"(0"
X`009Print`009Tab(27);"lqqqqqqqqqqqqqqqqqqqqqqqqk"
X`009For`009ROW = 1 To 10
X`009Print`009Tab(24);BOL$;ROW - 1;NOR$;"x";
X`009For`009COL = 1 To 8
X`009If`009FONT%(ANS, ROW, COL) = 0 Then
X`009Print`009"   ";
X`009Else
X`009Print`009INV$;BOL$;"   ";NOR$;
X`009End`009If
X`009Next`009COL
X`009Print`009"x"
X`009Next`009ROW
X`009Print`009Tab(27);"mqqqqqqqqqqqqqqqqqqqqqqqqj";Chr$(27);"(B"
X`009Print
X`009Print`009Tab(20);"Space To Toggle Dot - Arrow Keys To Move."
X`009Print`009Tab(20);"             Ctrl Z - Exits."
X`009Print`009Tab(20);"     Ctrl E - Erase, Ctrl L - Redraw."
X`009Let`009CURSV=9
X`009Let`009CURSH=29
X
X110`009Print`009STC$;Str$(CURSV);";";Str$(CURSH);"H";
X`009Let`009ANS$ = Inkey$(0%, Wait)
X`009If`009ANS$=Chr$(12) Then
X`009Print
X`009Goto`009100
X`009End`009If
X`009If`009ANS$=Chr$(26) Then 40
X`009End`009If
X`009If`009ANS$=Chr$(5) Then
X`009For`009ROW = 1 To 10
X`009For`009COL = 1 To 8
X`009Let`009FONT%(ANS, ROW, COL) = 0%
X`009Next`009COL
X`009Next`009ROW
X`009Print
X`009Goto`009100
X`009End`009If
X`009If`009ANS$=Chr$(32) Then
X`009If`009FONT%(ANS, CURSV-8, (CURSH-2)/3 - 8) = 0 Then
X`009Print`009INV$;BOL$;"   ";NOR$;
X`009Let`009FONT%(ANS, CURSV-8, (CURSH-2)/3 - 8) = 1
X`009Else
X`009Print`009"   ";NOR$;
X`009Let`009FONT%(ANS, CURSV-8, (CURSH-2)/3 - 8) = 0
X`009End`009If
X`009End`009If
X`009If`009ANS$="UP" And CURSV > 9 Then
X`009Let`009CURSV = CURSV - 1
X`009End`009If
X`009If`009ANS$="DOWN" And CURSV < 18 Then
X`009Let`009CURSV = CURSV + 1
X`009End`009If
X`009If`009ANS$="LEFT" And CURSH > 29 Then
X`009Let`009CURSH = CURSH - 3
X`009End`009If
X`009If`009ANS$="RIGHT" And CURSH < 50 Then
X`009Let`009CURSH = CURSH + 3
X`009End`009If
X`009Goto`009110
X
X120`009Print`009CLS$;INV$;BOL$;"Load Font Option:";NOR$
X`009Print`009STC$;Str$(10);";";Str$(0);"H";
X`009Input`009"Full File Name For Workspace                  ";FILE$
X`009Print`009WTE$;
X`009Open`009FILE$ For Input As File #1
X`009For`009CHAR = 1 To 94
X`009Input`009Line #1,ANS$
X`009Let`009CBT = 0
X`009For`009ROW = 1 To 10
X`009For`009COL = 1 to 8
X`009Let`009CBT = CBT + 1
X`009Let`009FONT%(CHAR, ROW, COL)=Val(Seg$(ANS$, CBT, CBT))
X`009Next`009COL
X`009Next`009ROW
X`009Next`009CHAR
X`009Close`009#1
X`009Goto`00940
X
X130`009Print`009WTE$;
X`009Print`009Chr$(27);"P0;1;1;4;1;1{<";
X`009For`009CHAR = 1 To 94
X`009For`009COL = 1 to 8
X`009Let`009MULS% = 32
X`009Let`009ACC% = 63
X`009For`009ROW = 6 To 1 Step -1
X`009Let`009ACC% = ACC% + MULS% * FONT%(CHAR, ROW, COL)
X`009Let`009MULS% = MULS% / 2
X`009Next`009ROW
X`009Print`009Chr$(ACC%);
X`009Next`009COL
X`009Print`009"/";
X`009For`009COL = 1 to 8
X`009Let`009MULS% = 8
X`009Let`009ACC% = 63
X`009For`009ROW = 10 To 7 Step -1
X`009Let`009ACC% = ACC% + MULS% * FONT%(CHAR, ROW, COL)
X`009Let`009MULS% = MULS% / 2
X`009Next`009ROW
X`009Print`009Chr$(ACC%);
X`009Next`009COL
X`009Print`009";";
X`009Next`009CHAR
X`009Print`009Chr$(27);"/";Chr$(27);"M";
X`009Print`009CLS$;INV$;BOL$;"View The Font Option:";NOR$
X`009Print`009"`027(0"
V`009Print   "`027[4;1H   lqqqwqqqwqqqwqqqwqqqwqqqwqqqwqqqwqqqwqqqwqqqwqqqwqqqwq
Xqqqqqk"
V`009Print   "`027[5;1H   x   x   x   x   x   x   x   x   x   x   x   x   x   x 
X     x"
V`009Print   "`027[6;1H   x   x   x   x   x   x   x   x   x   x   x   x   x   x 
X     x"
V`009Print`009"`027[7;1H   tqqqvqwqvqwqvqwqvqwqvqwqvqwqvqwqvqwqvqwqvqwqvqwqvqwqv
Xqwqqqqvqk"
V`009Print   "`027[8;1H   x     x   x   x   x   x   x   x   x   x   x   x   x   
Xx      x"
V`009Print   "`027[9;1H   x     x   x   x   x   x   x   x   x   x   x   x   x   
Xx      x"
V`009Print   "`027[10;1Hlqqvwqqqqvwqqvwqqvwqqvwqqvwqqvwqqvwqqvwqqvwqqvwqqvwqqvwq
Xqvk     x"
V`009Print`009"`027[11;1Hx   x     x   x   x   x   x   x   x   x   x   x   x   x
X   x     x"
V`009Print`009"`027[12;1Hx   x     x   x   x   x   x   x   x   x   x   x   x   x
X   x     x"
V`009Print`009"`027[13;1Htqqqvqqqwqvqwqvqwqvqwqvqwqvqwqvqwqvqwqvqwqvqwqvqwqvqwqv
Xqqqvqwqqqj"
V`009Print`009"`027[14;1Hx       x   x   x   x   x   x   x   x   x   x   x   x  
X     x"
V`009Print`009"`027[15;1Hx       x   x   x   x   x   x   x   x   x   x   x   x  
X     x"
V`009Print`009"`027[16;1Hmqqqqwqqvqqqvwqqvqqqvqqqvqqqvqqqvqqqvqqqvqqqvqqqvwqqvqq
Xqqqqqj"
X`009Print`009"`027[17;1H     x       x                                   x"
X`009Print`009"`027[18;1H     x       x                                   x"
X`009Print`009"`027[19;1H     mqqqqqqqvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj"
X`009Print`009"`027(<"
X`009Print`009"`027[5;6H~`027[3C!`027[3C@`027[3C#`027[3C$`027[3C%`027[3C^"
X`009Print`009"`027[5;34H&`027[3C*`027[3C(`027[3C)`027[3C_`027[3C+`027[2CDelete"
X`009Print`009"`027[6;6H```027[3C1`027[3C2`027[3C3`027[3C4`027[3C5`027[3C6"
X`009Print`009"`027[6;34H7`027[3C8`027[3C9`027[3C0`027[3C-`027[3C="
X`009Print`009"`027[8;6HTab`027[3CQ`027[3CW`027[3CE`027[3CR`027[3CT`027[3CY"
X`009Print`009"`027[8;36HU`027[3CI`027[3CO`027[3CP`027[3C{`027[3C}`027[2CReturn"
X`009Print`009"`027[9;12Hq`027[3Cw`027[3Ce`027[3Cr`027[3Ct`027[3Cy"
X`009Print`009"`027[9;36Hu`027[3Ci`027[3Co`027[3Cp`027[3C[`027[3C]"
X`009Print`009"`027[11;2HCtl`027[1CLock`027[3CA`027[3CS`027[3CD`027[3CF`027[3CG"
V`009Print`009"`027[11;33HH`027[3CJ`027[3CK`027[3CL`027[3C:`027[3C";'"';"`027[3C
X|"
X`009Print`009"`027[12;13Ha`027[3Cs`027[3Cd`027[3Cf`027[3Cg"
X`009Print`009"`027[12;33Hh`027[3Cj`027[3Ck`027[3Cl`027[3C;`027[3C'`027[3C\"
X`009Print`009"`027[14;2HShift`027[4C>`027[3CZ`027[3CX`027[3CC`027[3CV`027[3CB"
X`009Print`009"`027[14;35HN`027[3CM`027[3C,`027[3C.`027[3C?`027[2CShift"
X`009Print`009"`027[15;11H<`027[3Cz`027[3Cx`027[3Cc`027[3Cv`027[3Cb"
X`009Print`009"`027[15;35Hn`027[3Cm`027[3C,`027[3C.`027[3C/"
X`009Print`009"`027[17;7HCompose`027[15CSpace"
X`009Print`009"`027[18;7HChar"
X`009Print`009"`027[20;1H`027(B"
X`009Print`009Tab(30);"Press Any Key To Continue.";
X`009Let`009ANS$ = Inkey$(0%, Wait)
X`009Goto`00940
X
X140`009Print`009CLS$;INV$;BOL$;"Create Output Text Option:";NOR$
X`009Print`009STC$;Str$(10);";";Str$(0);"H";
X`009Input`009"Full File Name For Output File                     ";FILE$
X`009Print`009STC$;Str$(12);";";Str$(0);"H";
X`009Print`009"For ``<ESC>(B', Or ``<ESC>(<' Set [(B, <) Default B] : ";
X`009Let`009ANS$ = Inkey$(0%, Wait)
X`009If`009ANS$<>"<" Then
X`009Let`009ANS$="B"
X`009End`009If
X`009Print`009WTE$;
X`009Open`009FILE$ For Output As File #1, Recordsize 132
X`009For`009OLIN = 1 To 93 Step 2
X`009Print`009#1,Chr$(27);"P0;";Str$(OLIN);";1;4;1;1{";ANS$;
X`009For`009CHAR = OLIN To OLIN + 1
X`009For`009COL = 1 to 8
X`009Let`009MULS% = 32
X`009Let`009ACC% = 63
X`009For`009ROW = 6 To 1 Step -1
X`009Let`009ACC% = ACC% + MULS% * FONT%(CHAR, ROW, COL)
X`009Let`009MULS% = MULS% / 2
X`009Next`009ROW
X`009Print`009#1,Chr$(ACC%);
X`009Next`009COL
X`009Print`009#1,"/";
X`009For`009COL = 1 to 8
X`009Let`009MULS% = 8
X`009Let`009ACC% = 63
X`009For`009ROW = 10 To 7 Step -1
X`009Let`009ACC% = ACC% + MULS% * FONT%(CHAR, ROW, COL)
X`009Let`009MULS% = MULS% / 2
X`009Next`009ROW
X`009Print`009#1,Chr$(ACC%);
X`009Next`009COL
X`009Print`009#1,";";
X`009Next`009CHAR
X`009Print`009#1,Chr$(27);"/";Chr$(27);"M"
X`009Next`009OLIN
X`009Close`009#1
X`009Goto`00940
X
X150`009End
$ GOSUB UNPACK_FILE
$ EXIT

