Classic Computer Magazine Archive COMPUTE! ISSUE 79 / DECEMBER 1986 / PAGE 82

Fontier 128

Tapan Desai

This thoughtfully designed program provides all the features you could ask for in an 80-column character editor for the Commodore 128. The custom characters you create with this program can be used in CP/M and Commodore 64 mode as well as Commodore 128 mode. An 80-column monitor and disk drive are required.

The 80-column video display of the Commodore 128 is a significant improvement over the chunky 40-column display of its predecessor, the Commodore 64. In fact the 128's 80-column resolution compares very favorably with those of machines costing much more. One thing the 80-column screen lacks, however, is a character set of its own: It borrows the familiar 40-column character definitions. These characters do not do justice to the superb resolution of the 80-column screen, since they were designed to overcome the limitations of a coarser screen format.

"Fontier 128" helps you create new 80-column fonts. It gives you complete control over character design and manipulation and makes extensive use of the 128's windowing abilities. The program is entirely menu-driven: All you need to do is choose options from the onscreen menus and follow the program's prompts. Best of all, the fonts you create with Fontier 128 can be installed and used independently with other programs—in CP/M and Commodore 64 mode as well as 128 mode.

Typing It In

Type in Fontier 128 and save a copy to disk or tape. Although the program uses a machine language routine, this part of the program is POKEd into memory from BASIC. You don't need to understand machine language in order to use Fontier 128. Enter it as you would any BASIC program, Save the program on disk before you run it.

Before you run the program, be sure that your 80-column monitor is properly connected and that the 80-column screen is the active display. Also, check that the 40/80 DISPLAY key is depressed to the 80-column position so that the 80-column display will remain active after you press RUN/STOP-RESTORE. Since the program runs in FAST mode, it does not work at all with a 40-column monitor.

When you run Fontier 128, it spends a few seconds initializing, then it displays a screen containing four windows. Here's an explanation of what the windows contain.

The pattern window is located at the upper left. All pixel-level work is done here. The window displays an enlarged view of the current character (the one you are editing), the character set number (0 or 1), and the current character number (0-255). The blinking element in the pattern window is the pixel cursor.

The character set window is centrally placed. It shows all the characters of a set in their true size. The blinking character in this window marks the current character and is referred to as the character cursor.

The dialog window on the right displays prompts and receives input from you. When you begin the program, this window shows a menu of special keys.

The menu window is a static portion of the screen which displays the various options available to you.

One-Key Commands

Every command in Fontier 128 is invoked with a single keystroke Here's a description of what each command key does.

General Commands

Key Description

cursor keys Move the pixel cursor in the pattern window.

f1 Move character cursor up.

f3 Move character cursor down.

f5 Move character cursor left.

f7 Move character cursor right.

STOP Restore original (40-column) character set and stop program

A Alternate between character sets 0 (uppercase/graphics) and 1(lowercase/uppercase).

Character Manipulation Commands

Key Description

+ Turn pixel on and move cursor.

- Turn pixel on and move cursor.

R Reverse character(s) and move character cursor.

I Invert character.

@ Rotate character clockwise.

SHIFT-CLR/HOME Clear current character.

f2 Slide character pattern up.

f4 Slide character pattern down.

f6 Slide character pattern left.

f8 Slide character pattern right.

M Memorize character(s) starting from the current character.

C Copy memorized character(s) from the current character onward. (An M command should always precede this command.)

Disk Commands

Key Description

S Save Font file. Files saved by this option are program files. They may be loaded and RUN like any BASIC program in 128 made. Press RETURN to abort.

L Load Font file (don't try to load a file created by any other program). Press RETURN to abort.

$ Display disk directory.



"Fontier 128" includes many one-key commands for easily creating and manipulating your custom-designed character sets.

What You See Is What You Get

When you change a character definition in the pattern window, the change appears immediately in the character-set window, too. The advantage of this system is that you can see immediately how a character will look in its normal size and in relation to other characters in the set. The menu and dialog windows always use the character set not being edited at that time. If you're editing uppercase/graphics characters (set 0), all text in the dialog and menu windows will use the lowercase/uppercase set (set 1), and vice versa, It's best to edit only one character set at a time. For example, if you change all the letters in the uppercase/graphics set to new shapes and then press A to edit the lowercase/uppercase set, the text in the menu and dialog windows will use those new shapes and will be unreadable. The solution is to complete all your editing of one character set, save your changes, and then restore the original character set before switching to edit the other set.

Once you've created and saved a custom character set, how do you use it? With Fontier, it's easy. When you save a character set, the program automatically adds a routine to the character set data that will install the new character set for you. You don't need Fontier to load the new character definitions; simply load and run the font file as you would a BASIC program. For example, if you use Fontier to design an italic character set and save it using the name ITALIC.FNT, you can enable your custom character set at any time by typing RUN "ITALIC.FNT". You must not have a hi-res graphics area allocated when you run the font file. For example, Fontier allocates the hires area (see the GRAPHIC 1 statement in line 100) to create an area of reserved memory. You must reclaim this space before running a font file. Use the statement GRAPHIC CLR to deallocate any existing graphics area. The built-in font loader program will delete itself after the new font is loaded. (You should note, however, that loading and running the font file will overwrite any existing BASIC program.)

Once a new character set is in place, it behaves exactly like the original character set. It is not affected by RUN/STOP-RESTORE, and will be preserved intact if you switch to CP/M or Commodore 64 mode. For instance, you can run an 80-column CP/M word processor or telecommunications program with your own, personal character set. The same is true of any program written for a 128 in Commodore 64 mode that takes advantage of the 80-column display, such as "SpeedScript-80" (see the June 1986 issue of COMPUTE!’s GAZETTE). Of course, any 80-column program that installs its own custom character set will overwrite the Fontier 128 character set. When using a Fontier 128 font in CP/M mode, keep in mind that CP/M always uses character set 1. You will not see any custom characters from set 0 in CP/M mode unless you invoke the alternate character set escape sequence (ESC G1).

Fontier 128 opens exciting possibilities in font design. For instance, 80-column word processors may now include foreign-language character sets, mathematical or scientific symbols, italics, or subscript and superscript characters. Special characters can be used to form background textures in charts or graphs, and even to build shapes in arcade-type games.

Fontier 128

For Instructions on entering this program, please refer to "COMPUTE!'s Guide to Typing In Programs" in this issue of COMPUTE!.

AQ 100 FAST:GRAPHIC 1:GRAPHIC {SPACE}5

BP 110 TRAP 1920

CP 120 GE=15935:PU=15974

EC 130 MA=15993:SE=16060

KP 140 BA=DEC( "1D00") :BU=DEC("2D00"):BB=DEC("1C01"):BC=DEC("3E00")

HR 150 IF PEEK(BC)<>10 OR PEEK(BC+2)<>10 THEN GOSUB 2230

PG 160 BANK 15

PB 170 SYS GE,0,0,255:SYS GE,1,0,255

SE 180 GOSUB 1770

GE 190 GOSUB 1570

JC 200 GOSUB 1280

JA 210 GOSUB 1240

FF 220 POKE 208,0:GETKEY X$

XR 230 X=INSTR(K$,X$):IF X=0 THEN 330

GS 240 ON X GOTO 510,540,250,260,270,280,290,300,310,320,1330,1380,1430,1470

AQ 250 CP=(CP-8) AND 63 : GOTO 210

JQ 260 CP=(CP+8) AND 63:GOTO 210

FB 270 CP=(CP-1) AND 63:GOTO 210

RB 280 CP=(CP+l) AND 63:GOTO 210

XR 290 CH=(CH-1) AND 255 : GOTO {SPACE}200

EC 300 CH=(CH+1) AND 255:GOTO {SPACE}200

BQ 310 CH=(CH-32) AND 255:GOTO 200

KQ 320 CH=(CH+32) AND 255 : GOTO 200

FQ 330 IF X$="A"THEN CS=1-CS:GOTO 190

AG 340 IF X$="R"THEN GOSUB 570:GOTO 200

HQ 350 IF X$="@"THEN GOSUB 700:GOTO 440

MA 360 IF X$="{CLR}"THEN GOSUB 670:GOTO 440

EF 370 IF X$="S"THEN GOSUB 1180:GOTO 210

RB 380 IF X$="L"THEN GOSUB 1090:GOTO 210

RE 390 IF X$="$"THEN GOSUB 1150:GOTO 210

QP 400 IF X$="C"THEN GOSUB 920:GOT0 210

XJ 410 IF X$="M"THEN GOSUB 800:GOTO 210

DG 420 IF X$="I"THEN GOSUB 1510:GOTO 440

QR 430 GOTO 220

QC 440 SYS PU,CS,CH,0:GOTO 210

ER 450 REM *** GENERAL COMMAND S***

HH 460 C=BA+CS*2048+CH*8+CP/8

QX 470 B=2?(7-(CPAND7))

BE 480 RETURN

JD 490 C=BA+CS*2048+CH*8

QF 500 RETURN

DD 510 GOSUB 460

XQ 520 POKE C,PEEK(C) OR B

QH 530 GOTO 560