home *** CD-ROM | disk | FTP | other *** search
- Program FontEdit;
- { This program helps create font characters for the Epson and compatible }
- { printers. The font codes are stored in a file and can be loaded into }
- { the printer RAM with the program EpsonLdr. }
- { }
- { Version 1.0 Copyright (c) 1986 }
- { Writen by: Claire A. Rinehart }
- { 18 C University Houses }
- { Madison, WI 53705 }
- { }
-
- CONST
- MinChar = 0; {lowest character number in font}
- MaxChar = 255; {maximum number of characters in font}
- MaxCol = 11; {maximum column number for sfont}
- EliteOn = #27'M'; { }
- EliteOff = #27'P'; { }
- CompressOn = #15; { }
- CompressOff = #18; { }
- EmphOn = #27'E'; { }
- EmphOff = #27'F'; { }
- DoubleOn = #27'G'; { Epson printer codes }
- DoubleOff = #27'H'; { }
- UnderOn = #27'-1'; { }
- UnderOff = #27'-0'; { }
- RAMon = #27'%'#01#00; { }
- RAMoff = #27'%'#00#00; { }
- LoadRAM = #27'&'#00; { }
- Print128on = #27'6'; { }
- Print128off = #27'7'; { }
- Print0on = #27'I1'; { }
- Print0off = #27'I0'; { }
- Reset = #27'@'; { }
-
-
- TYPE
- FonType = array[0..MaxCol] of integer;
- ScreenType = array[0..MaxCol, 0..7] of integer;
- FileType = file of FonType;
- Str4 = Array[1..4] of char;
-
- VAR
- font : array[MinChar..MaxChar] of fontype;
- sfont : screentype;
- { The variables sfont and font are used to display the font characters}
- { on the screen and store them in a disk file respectively. }
- { BitPower }
- { 7 * * * * * * * * * * * }
- { 6 * * * * * * * * * * * sfont is an array }
- { 5 * * * * * * * * * * * of 0s and 1s. }
- { 4 * * * * * * * * * * * A 1 will be displayed}
- { 3 * * * * * * * * * * * as a dot on the }
- { 2 * * * * * * * * * * * screen and a 0 as a }
- { 1 * * * * * * * * * * * blank. }
- { 0 * * * * * * * * * * * }
- { 0 1 2 3 4 5 6 7 8 9 10 11 ColNum }
- { }
- { | | | | | | | | | | | | }
- { each font character }
- { 0 1 2 3 4 5 6 7 8 9 10 11 is an array of }
- { | integers that contain}
- { bit 7 1=top 8 pins;0= bottom 8 pins the summation of the }
- { pattern 6 \ binary values found }
- { of 5 > starting column for in sfont. Notice }
- { ColNum 0 4 / proportional spacing that ColNum 0 is not }
- { 3 \ displayed. This is }
- { 2 \ ending column for the attribute integer}
- { 1 / proportional spacing and is used as shown }
- { 0 / in the figure. }
- FontFile : Filetype; {file identification variable}
- CopyFile : Filetype;
- CharNum : Integer; {counter for selecting a character out of font}
- Ans : integer; {return variable for the Answer proc }
- ColNum, {defined above}
- BitPower : integer; {defined above}
- Extension: Str4; {file name extension characters defined as .FNT }
-
- Type
- Str255 = String[255]; { \ Used by Answer.inc. }
- Str80 = String[80]; { / }
- Var
- Ch : char; {character returned by Mainmenu}
-
- {$I Var.inc }
- {$I WindMngr.inc }
- {$I Beep.inc }
- {$I Answer.inc }
- {$I IXtoN.inc }
- {$I DirExt.inc }
- {$I Files.inc }
-
- Procedure ShowDot; {prints a dot to the screen}
- begin
- if frac(ColNum / 2.0) > 0 then {If an odd column then print}
- begin {a light blue dot }
- textcolor(LightBlue);
- write(chr(4));
- end
- else
- begin
- textcolor(Blue); {If an even column then print}
- write(chr(4)); {a dark blue dot }
- end;
- end; {ShowDot}
-
- Procedure ShowChar; {Use sfont array to create character}
- begin
- ClrScr;
- for BitPower := 7 downto 0 do
- begin
- for ColNum := 1 to MaxCol do
- begin
- if sfont[ColNum, BitPower] = 1 then
- begin {print a 1 in sfont as a dot}
- gotoXY(ColNum, 8 - BitPower);
- ShowDot; {Prints the appropriate colored dot}
- end;
- end;
- end;
- end; {ShowChar}
-
- Procedure DisplayChar;
- Var
- CharTitle : String[80]; {Title for window}
- TempChar : Fontype; {Temporary work character}
- Begin
- Add_Window(10,10,MaxCol+11,21,1,7,2); {display character window}
- TempChar := font[CharNum];
- for ColNum := 0 to MaxCol do {convert font to sfont bit array}
- begin
- for BitPower := 7 downto 0 do
- begin
- sfont[ColNum, BitPower] := Trunc(TempChar[ColNum]/IXtoN(2,BitPower)); {decode ColNum into a bit array}
- if sfont[ColNum, BitPower] = 1 then {if the bitpower is a 1 then }
- TempChar[ColNum] := TempChar[ColNum] - IXtoN(2,BitPower); {subtract that power from the total ColNum}
- end;
- end;
- Str(CharNum:3,CharTitle); {\ }
- CharTitle := 'Char# ' + CharTitle; { >set up window title}
- Window_Title(CharTitle,(14 + (0 * 16))); {/ }
- ShowChar; {put character pattern on screen}
- End; {DisplayChar}
-
- Procedure CharEdit;
- Var
- EditExit : boolean; {used to determine if edit should be exited}
- PrtChar : boolean; {used to determine if the character should be printed}
- pin : string[6]; {\ }
- StartCol : Integer; { > used to set up the attribute bit }
- EndCol : Integer; {/ }
- Key : Char;
- CopyNum : Integer;
- tchar : ScreenType; {temporary array for shifting character}
- CapLock : Integer; {used to read caplock key value}
- IOErr : Integer;
- Error : Str80;
-
- { local procedures }
- procedure ShowPos; {show the position of the cursor}
- begin
- gotoXY(1,9);
- writeln('Row : ',BitPower:1);
- write('Column: ',ColNum:2);
- gotoXY(ColNum, 8 - BitPower);
- end;
-
- procedure PrintLine; {prints a line of the character on the printer}
- Var
- I : integer;
- begin
- write(Lst,RAMon); {select RAM for printing}
- for I := 1 to 15 do write(Lst,chr(33)); {print single strike }
- write(Lst,DoubleOn); {select double strike}
- for I := 1 to 16 do write(Lst,chr(33));
- write(Lst,DoubleOff,EmphOn); {double off, emphasized on}
- for I := 1 to 16 do write(Lst,chr(33));
- write(Lst,DoubleOn); {double added to emphasized}
- for I := 1 to 16 do write(Lst,chr(33));
- write(Lst,DoubleOff,EmphOff,RAMoff); {select ROM for printing and turn off double and emphasized modes}
- writeln(Lst);
- end; {PrintLine}
- { end local procedures }
-
- Begin {Character edit procedure}
- EditExit := false;
- PrtChar := false;
- ColNum := 1;
- BitPower := 7;
- gotoXY(ColNum,8 - BitPower);
- ShowPos;
- { ************** Edit Characters ******************* }
- repeat
- read(Kbd,Key);
- if KeyPressed then
- begin
- read(Kbd,Key);
- case Key of
- 'H' : begin {up arrow}
- BitPower := BitPower + 1;
- if BitPower > 7 then BitPower := 0;
- ShowPos; {subt bitpower from 8 to get}
- end; {proper display line }
- 'M' : begin
- ColNum := ColNum + 1; {right arrow}
- if ColNum > MaxCol then ColNum := 1;
- ShowPos;
- end;
- 'K' : begin {left arrow}
- ColNum := ColNum-1;
- if ColNum < 1 then ColNum := MaxCol;
- ShowPos;
- end;
- 'P' : begin {down arrow}
- BitPower := BitPower - 1;
- if BitPower < 0 then BitPower := 7;
- ShowPos;
- end;
- 'G' : begin {home}
- ColNum := 1;
- BitPower := 7;
- ShowPos;
- end;
- 'O' : begin {end}
- ColNum := MaxCol;
- BitPower := 0;
- ShowPos;
- end;
- 'I' : begin {pg-up}
- BitPower := 7;
- ShowPos;
- end;
- 'Q' : begin {pg-down}
- BitPower := 0;
- ShowPos;
- end;
- 'R' : begin {insert}
- {check for adjacent dots}
- if ((sfont[ColNum-1,BitPower]>0) AND (sfont[ColNum-1,BitPower] = 1)) OR (sfont[ColNum+1,BitPower] = 1) then
- beep(1)
- else
- begin
- sfont[ColNum,BitPower] := 1;
- ShowDot;
- end;
- CapLock := mem[0000:1047]; {test for caplock on/off}
- if CapLock in [64, 96, 192, 224] then
- begin
- ColNum := ColNum + 2;
- if ColNum > MaxCol then
- begin
- ColNum := 1;
- BitPower := BitPower -1;
- if BitPower < 0 then BitPower := 7;
- end;
- end;
- ShowPos;
- end;
- 'S' : begin {del}
- sfont[ColNum,BitPower] := 0;
- write(' ');
- CapLock := mem[0000:1047]; {test for caplock on/off}
- if CapLock in [64, 96, 192, 224] then
- begin
- ColNum := ColNum -2;
- if ColNum < 1 then
- begin
- ColNum := MaxCol;
- BitPower := BitPower + 1;
- if BitPower > 7 then BitPower := 0;
- end;
- end;
- ShowPos;
- end;
- ';' : begin {F1 = Shift left}
- tchar := sfont;
- FillChar(sfont, sizeof(sfont),0);
- for ColNum := 2 to MaxCol do
- for BitPower := 7 downto 0 do
- sfont[ColNum - 1, BitPower] := tchar[ColNum, BitPower];
- ShowChar;
- ShowPos;
- end;
- '<' : begin {F2 = Shift up}
- tchar := sfont;
- FillChar(sfont, sizeof(sfont),0);
- for ColNum := 1 to MaxCol do
- for BitPower := 6 downto 0 do
- sfont[ColNum, BitPower + 1] := tchar[ColNum, BitPower];
- ShowChar;
- ShowPos;
- end;
- '=' : begin {F3 = Shift down}
- tchar := sfont;
- FillChar(sfont, sizeof(sfont),0);
- for ColNum := 1 to MaxCol do
- for BitPower := 7 downto 1 do
- sfont[ColNum, BitPower - 1] := tchar[ColNum, BitPower];
- ShowChar;
- ShowPos;
- end;
- '>' : begin {F4 = Shift right}
- tchar := sfont;
- FillChar(sfont, sizeof(sfont),0);
- for ColNum := 1 to 10 do
- for BitPower := 7 downto 0 do
- sfont[ColNum + 1, BitPower] := tchar[ColNum, BitPower];
- ShowChar;
- ShowPos;
- end;
- '?' : begin {F5 = Fill even columns}
- FillChar(sfont, sizeof(sfont),0);
- ColNum := 0;
- repeat
- for BitPower := 0 to 7 do sfont[ColNum, BitPower] := 1;
- ColNum := ColNum + 2;
- until ColNum > MaxCol;
- ShowChar;
- ShowPos;
- end;
- '@' : begin {F6 = Fill odd columns}
- FillChar(sfont, sizeof(sfont),0);
- ColNum := 1;
- repeat
- for BitPower := 0 to 7 do sfont[ColNum, BitPower] := 1;
- ColNum := ColNum + 2;
- until ColNum > MaxCol;
- ShowChar;
- ShowPos;
- end;
- 'A' : begin {F7 = Clear character}
- FillChar(sfont, sizeof(sfont),0);
- ShowChar;
- ShowPos;
- end;
- 'B' : begin {F8 = Copy character from within current font}
- Remove(1);
- repeat
- Add_Window(38,10,80,14,14,2,1);
- write('Enter a character number. (',MinChar,'-',MaxChar,'): ');
- read(CopyNum);
- Remove(1);
- until CopyNum in [MinChar..MaxChar];
- font[CharNum] := font[CopyNum];
- DisplayChar;
- ShowPos;
- end;
- 'C' : begin {F9 = print character}
- EditExit := true;
- PrtChar := true;
- end;
- 'D' : EditExit := true; {F10 = exit}
- end; {Case of Key}
- end;
- until EditExit = true;
- { ********* Edit character attribute column ********* }
- Add_Window(30,10,80,20,1,7,2); {show character attribute window}
- If sfont[0,7] = 1 then
- pin := 'top'
- else
- pin := 'bottom';
- StartCol := sfont[0,6]*4 + sfont[0,5]*2 + sfont[0,4];
- EndCol := sfont[0,3]*8 + sfont[0,2]*4 + sfont[0,1]*2 + sfont[0,0];
- if EndCol = 0 then
- begin
- EndCol := MaxCol;
- pin := 'top';
- sfont[0,7] := 1;
- sfont[0,3] := 1;
- sfont[0,2] := 0;
- sfont[0,1] := 1;
- sfont[0,0] := 1;
- end;
- writeln('The current pin setting is for the ',pin,' 8 pins.');
- writeln('The current starting column is ',StartCol,'.');
- writeln('The current ending column is ',EndCol,'.');
- writeln;
- write('Do you wish to change these values? ');
- answer('yes,no',ans,false);
- writeln;
- if ans = 1 then
- begin
- writeln('Enter choice (top/bottom) for the pin setting.');
- answer('bottom, top',sfont[0,7],false);
- sfont[0,7] := sfont[0,7] - 1;
- writeln;
- repeat
- write('Enter the starting column number. (0-7) ');
- answer('1,2,3,4,5,6,7,0',StartCol,false);
- if StartCol in [1, 3, 5, 7] then sfont[0,4] := 1 else sfont[0,4] := 0;
- if StartCol in [2, 3, 6, 7] then sfont[0,5] := 1 else sfont[0,5] := 0;
- if StartCol in [4, 5, 6, 7] then sfont[0,6] := 1 else sfont[0,6] := 0;
- if StartCol = 8 then StartCol := 0;
- writeln;
- write('Enter the ending column number. (01,2,3..11) ');
- answer('01,2,3,4,5,6,7,8,9,10,11',EndCol,false);
- if EndCol in [1,3,5,7,9,11] then sfont[0,0] := 1 else sfont[0,0] := 0;
- if EndCol in [2,3,6,7,10,11] then sfont[0,1] := 1 else sfont[0,1] := 0;
- if EndCol in [4,5,6,7] then sfont[0,2] := 1 else sfont[0,2] := 0;
- if EndCol in [8,9,10,11] then sfont[0,3] := 1 else sfont[0,3] := 0;
- writeln;
- until StartCol < EndCol;
- end;
-
- { ************** Convert sfont back to Font ************** }
- { Convert edited sfont binary array back into the integer font array }
- for ColNum := 0 to MaxCol do
- begin
- font[CharNum, ColNum] := 0;
- for BitPower := 0 to 7 do
- font[CharNum, ColNum] := font[CharNum, ColNum] + sfont[ColNum,BitPower] * IXtoN(2,BitPower);
- end;
-
- { ************** Print character ************* }
- if PrtChar then
- begin
- repeat
- writeln(Lst,Reset); {reset printer}
- IOCheck(IOErr,Error);
- If Error <> '' then
- begin
- writeln(Error);
- write('Try printer again? (Y/N) ');
- Answer('yes,no',Ans,false);
- writeln;
- end;
- until (Ans = 2) or (Error = '');
- if Error = '' then
- begin
- write(Lst,LoadRam,chr(33),chr(33)); {send character}
- for ColNum := 0 to MaxCol do write(Lst,chr(font[CharNum,ColNum])); {to printer RAM}
- writeln(Lst, 'Character # ',CharNum);
- write(Lst,UnderOn); {turn on underline}
- writeln(Lst, ' Single Double Emphasized Double-Emphasized');
- write(Lst,UnderOff); {turn off underline}
- write(Lst, 'Pica ');
- PrintLine;
- write(Lst, 'Elite ',EliteOn); {turn on Elite}
- PrintLine;
- write(Lst,EliteOff,'Compressed ',CompressOn); {Elite off, compressed on}
- PrintLine;
- writeln(Lst,Reset);
- end;
- end;
- End; {CharEdit}
-
- Procedure MainMenu;
- Var
- Exit : boolean; {variable tested for MainMenu exit condition}
- Error : Str80; {text description of error produced in I/O operations}
- Ans : integer; {return variable for answer procedure}
- IOErr : integer; {I/O error number}
- CopyNum : integer; {counter used for copying partial character files}
- I,C1,C2 : integer; {counter and range variables for copying partial character files}
- Begin
- FillChar(font, sizeof(font),0);
- Add_Window(30,1,80,18,5,1,2);
- Window_Title('Epson-JX80 Font Editor by C. A. Rinehart',(14+(0*16)));
- TextColor(15);
- write('Cursor keys ');
- TextColor(7);
- writeln(': Up, right = next character.');
- writeln(' down,left = last character.');
- writeln;
- TextColor(15);
- write('Fn1 ');
- TextColor(7);
- writeln(': Edit character.');
- TextColor(15);
- write('Fn2 ');
- TextColor(7);
- writeln(': Advance to next character.');
- TextColor(15);
- write('Fn3 ');
- TextColor(7);
- writeln(': Backup to previous character.');
- TextColor(15);
- write('Fn4 ');
- TextColor(7);
- writeln(': Select character number');
- TextColor(15);
- write('Fn5 ');
- TextColor(7);
- writeln(': Read font file.');
- TextColor(15);
- write('Fn6 ');
- TextColor(7);
- writeln(': Save font file.');
- TextColor(15);
- write('Fn7 ');
- TextColor(7);
- writeln(': Copy characters from another font.');
- TextColor(15);
- write('Fn8 ');
- TextColor(7);
- writeln(': Clear current font.');
- TextColor(15);
- write('Fn9 ');
- TextColor(7);
- writeln(': Print current font on printer.');
- TextColor(15);
- write('Fn10 ');
- TextColor(7);
- writeln(': Exit program.');
- DisplayChar;
- Exit := false;
- repeat
- read(kbd,Ch);
- if KeyPressed then
- begin
- read(kbd,Ch);
- case Ch of
- ';' : begin {Fn1=edit character}
- Remove(1);
- Add_Window(30,2,80,22,5,1,2);
- Window_Title('Use these keys to edit character',(14+(0*16)));
- writeln;
- TextColor(15);
- write('Cursor keys ');
- TextColor(7);
- writeln(': Up, down, right, left, home, end,');
- writeln(' top & bottom.');
- TextColor(15);
- write('Ins ');
- TextColor(7);
- writeln(': Place a dot on the screen.');
- TextColor(15);
- write('Del ');
- TextColor(7);
- writeln(': Delete a dot on the screen.');
- TextColor(15);
- write('Caps Lock');
- TextColor(7);
- writeln(': Toggle for INS and DEL. Moves cursor');
- writeln(' 2 spaces after function.');
- TextColor(15);
- write('Fn1 ');
- TextColor(7);
- writeln(': Shift character left one column.');
- TextColor(15);
- write('Fn2 ');
- TextColor(7);
- writeln(': Shift character up one row.');
- TextColor(15);
- write('Fn3 ');
- TextColor(7);
- writeln(': Shift character down one row.');
- TextColor(15);
- write('Fn4 ');
- TextColor(7);
- writeln(': Shift character right one column.');
- TextColor(15);
- write('Fn5 ');
- TextColor(7);
- writeln(': Fill even columns with dots.');
- TextColor(15);
- write('Fn6 ');
- TextColor(7);
- writeln(': Fill odd columns with dots.');
- TextColor(15);
- write('Fn7 ');
- TextColor(7);
- writeln(': Clear character.');
- TextColor(15);
- write('Fn8 ');
- TextColor(7);
- writeln(': Copy a character from this font.');
- TextColor(15);
- write('Fn9 ');
- TextColor(7);
- writeln(': Print character on printer.');
- TextColor(15);
- write('Fn10 ');
- TextColor(7);
- writeln(': End edit.');
- DisplayChar;
- CharEdit;
- Remove(3);
- DisplayChar;
- end;
- '<','H','M' : begin {Fn2,up,right=Advance one character}
- Remove(1);
- CharNum := CharNum + 1;
- if CharNum > MaxChar then CharNum := MinChar;
- DisplayChar;
- end;
- '=','P','K' : begin {Fn3,down,left=Back-Up one character}
- Remove(1);
- CharNum := CharNum -1;
- if CharNum < MinChar then CharNum := MaxChar;
- DisplayChar;
- end;
- '>' : begin {Fn4=Choose a character number}
- Remove(1);
- repeat
- Add_Window(35,10,80,14,14,1,1);
- write('Enter a character number. (',MinChar,' - ',MaxChar,'): ');
- read(CharNum);
- Remove(1);
- until CharNum in [MinChar..MaxChar];
- DisplayChar;
- end;
- '?' : begin {Fn5=Read font from file}
- Remove(1);
- Add_Window(1,15,80,23,14,1,3);
- writeln('Read font from disk file.');
- repeat
- writeln('The current font files are:');
- Listdirectory;
- writeln;
- Error := 'O';
- OpenFile(FontFile,Error,Extension);
- If Error <> '' then
- begin
- writeln(Error);
- write('Try another file? (Y/N) ');
- Answer('yes,no',Ans,false);
- writeln;
- end;
- until (Ans = 2) or (Error = '');
- CharNum := MinChar;
- if Error = '' then
- while NOT EOF(FontFile) do
- begin
- read(fontfile, font[CharNum]);
- CharNum := CharNum + 1;
- end
- else
- begin
- writeln;
- writeln('No characters read from file!');
- beep(1);
- delay(2000);
- end;
- CloseFile(FontFile, Error);
- if Error <> '' then
- begin
- writeln('Close file error:');
- writeln(Error);
- beep(1);
- delay(2000);
- end;
- Remove(1);
- CharNum := MinChar;
- DisplayChar;
- end;
- '@' : begin {Fn6=Save font to file}
- Remove(1);
- Add_Window(1,15,80,23,14,1,3);
- writeln('Save font to disk file.');
- repeat
- writeln('The current font files are:');
- Listdirectory;
- writeln;
- Error := 'N';
- OpenFile(FontFile,Error,Extension);
- If Error <> '' then
- begin
- writeln(Error);
- write('Try another file? (Y/N) ');
- Answer('yes,no',Ans,false);
- writeln;
- end;
- until (Ans = 2) or (Error = '');
- if Error = '' then
- for CharNum := MinChar to MaxChar do write(FontFile, font[CharNum])
- else
- begin
- writeln;
- writeln('No characters written to file!');
- beep(1);
- delay(2000);
- end;
- CloseFile(FontFile, Error);
- if Error <> '' then
- begin
- writeln('Close file error:');
- writeln(Error);
- beep(1);
- delay(2000);
- end;
- Remove(1);
- CharNum := MinChar;
- DisplayChar;
- end;
- 'A' : begin {Fn7=Copy font from another font file}
- Remove(1);
- Add_Window(1,15,80,23,14,1,3);
- writeln('Copy characters from disk font file into present font.');
- repeat
- writeln('The current font files are:');
- Listdirectory;
- writeln;
- Error := 'O';
- OpenFile(CopyFile,Error,Extension);
- If Error <> '' then
- begin
- writeln(Error);
- write('Try another file? (Y/N) ');
- Answer('yes,no',Ans,false);
- writeln;
- end;
- until (Ans = 2) or (Error = '');
- CharNum := MinChar;
- if Error = '' then
- begin
- repeat
- write('Enter first character # to be copied. ');
- readln(c1);
- write('Enter last character # to be copied. ');
- readln(c2);
- write('Enter first character # to which the characters will be copied. ');
- readln(CharNum);
- until (c2 >= c1) and (CharNum in [MinChar..MaxChar]) and (c2 in [MinChar..MaxChar]);
- seek(copyfile,c1);
- CopyNum := c2-c1;
- while (NOT EOF(CopyFile)) and (CharNum <= MaxChar) and (CopyNum >= 0) do
- begin
- read(copyfile, font[CharNum]);
- CharNum := CharNum + 1;
- CopyNum := CopyNum - 1;
- end;
- end
- else
- begin
- writeln;
- writeln('No characters read from file!');
- beep(1);
- delay(2000);
- end;
- CloseFile(CopyFile, Error);
- if Error <> '' then
- begin
- writeln('Close file error:');
- writeln(Error);
- beep(1);
- delay(2000);
- end;
- Remove(1);
- CharNum := c1;
- DisplayChar;
- end;
- 'B' : begin {F8 = Clear current font}
- Remove(1);
- Add_Window(20,5,60,10,14,6,1);
- writeln(' CLEAR Current Font');
- write('Are you sure? ');
- Answer('yes,no',Ans,false);
- if ans = 1 then
- FillChar(font,sizeof(font),0);
- Remove(1);
- DisplayChar;
- end;
- 'C' : begin {Fn9 = Print Font}
- Add_Window(20,20,78,24,19,1,2);
- {$I-}
- repeat
- writeln(Lst,Reset); {reset printer}
- IOCheck(IOErr,Error);
- If Error <> '' then
- begin
- writeln(Error);
- write('Try printer again? (Y/N) ');
- Answer('yes,no',Ans,false);
- writeln;
- end;
- until (Ans = 2) or (Error = '');
- if Error = '' then
- begin
- writeln(' Sending font to printer,');
- writeln(' Please stand by . . .');
- write(Lst,LoadRam,chr(MinChar),chr(MaxChar)); {send character}
- for CharNum := MinChar to MaxChar do
- for ColNum := 0 to MaxCol do write(Lst,chr(font[CharNum,ColNum])); {to printer RAM}
- write(Lst,Print0on,Print128on); {Enable printing of 0-31 and 128-159}
- write(Lst,RAMon); {selects RAM as source of character set}
- for CharNum := MinChar to MaxChar do
- begin
- if frac(CharNum/16) = 0 then writeln(Lst,RAMoff,' ',CharNum-1,RAMon); {print 16 char / line}
- if CharNum in [7..15, 17..20, 24, 27, 127, 137, 255] then
- write(Lst,RAMoff,' ',RAMon) {print space instead of control code}
- else
- write(Lst, chr(CharNum)); {print character from RAM}
- end;
- writeln(Lst,Reset); {Reset printer codes}
- end;
- Remove(1);
- end;
- 'D' : begin {Fn10=Quit program}
- Remove(1);
- Add_Window(20,5,60,10,14,1,4);
- writeln(' EXIT');
- writeln('Are you sure? ');
- write('Have you saved your Font? (Y/N) ');
- Answer('yes,no',Ans,false);
- writeln;
- if ans = 1 then
- Exit := true;
- Remove(1);
- DisplayChar;
- end;
- end; {case}
- end;
- until Exit;
- End; {MainMenu}
-
- BEGIN
- ClrScr;
- Initialize;
- Extension[1] := '.';
- Extension[2] := 'F';
- Extension[3] := 'N';
- Extension[4] := 'T';
- INT24On; { interupt 24 error checking on at beginning. }
- CharNum := MinChar;
- TextColor(lightred);
- gotoxy(33,8);
- write('F O N T E D I T');
- TextColor(lightgreen);
- gotoxy(12,15);
- write('A font editor for EPSON JX, FX and compatible printers.');
- Textcolor(lightblue);
- gotoxy(30,22);
- write('by Claire A. Rinehart');
- Textcolor(cyan);
- gotoxy(34,24);
- write('Version 1.00');
- delay(5000);
- ClrScr;
- MainMenu;
- Remove(2);
- INT24Off; { interupt 24 error checking off before exiting. }
- Clrscr;
- END.