The Font Factory

by Sarah Keates

 

Issue 31

Jan/Feb 88

Next Article >>

<< Prev Article

 

 

Sarah Keates' character editor not only allows you to redefine characters, it automatically writes the subroutines to use the new character set in your own programs

Many readers will know that it is possible to change the character set on the Atari in BASIC and almost everybody has seen a changed character set for it is a technique used in many commercial games. There have been several character designers published in the past but most of them save only the DATA for the revised set of characters and leave the user to devise his or her own way of using the new character set. Now Font Factory will allow even those with the minimum of programming knowledge to generate and use their own characters sets. Font Factory will write the necessary subroutines for you! All you will need to do is ENTER the subroutine created into your own program and place an appropriate at the start of the program. It is even possible for you to load existing character sets such as those on the PAGE 6 issue disks and save them for use in your own programs.

The Font Factory is a flexible and powerful character editor. Fonts can be saved on disk or cassette either directly or in the form of Basic DATA statements. It can even generate a subroutine to install your custom sets into your own programs. The Font Factory runs on any 8-bit Atari with at least 32K of memory and a disk drive or cassette deck.

GETTING STARTED

Typing in The Font Factory is straightforward if you use TYPO 3, just type it in and SAVE it to disk or CSAVE to cassette. RUN the program and when the program has initialised, the main editing screen will be displayed. In the top part of the screen is a window showing the entire character set. In the middle of the screen is a menu of the available editing commands and the editing grid. On the grid, an enlarged view of the character currently being edited is displayed. Beneath the grid, the internal and ATASCII codes for the character are shown.

There is not room here for a full discussion on the theory of character definition but basically any point plotted in the 8 x 8 matrix used for each character will be shown as part of the character and any point not plotted will be shown as blank. If you do not understand the theory fully, just RUN the program and experiment by making some changes to a character and then storing it. You will see the results on screen and will soon get the hang of it.

________

We are proud to present Font Factory, not only because it is a good program but because its author, Sarah Keates, is just 14 years of age. Sarah lives in Belgium. The presentation of her program and article was one of the most professional we have ever had and puts many others to shame! Where are the other ladies, then? And how about some of the young ( and not so young!) lads seeing if they submit programs equally as good.


EDITING COMMANDS

The commands available are shown on screen at all times but for reference and greater explanation are as follows.

+ - * = Moves the cursor around the grid (there is no need to use CONTROL).

Space Bar Draws or deletes a point on the grid.

C Clears or fills the grid. If the program is in DRAW mode, then the grid will be filled in, if in delete mode, the grid will be emptied.

R Restores the character being edited to the ROM character.

S Stores the contents of the grid. The character set window will be updated to show the new character.

N Selects a new character to be edited. If the program is in CHARACTER input mode, type the character you wish to edit and press RETURN. If the program is in ASCII input mode, enter the ATASCII code of the character. NB: some characters cannot be entered in CHARACTER mode, for example Space (ATASCII 32).

< Selects the preceding character in the set to be edited. If the program reaches the beginning of the set, it will wrap around to the end of the set.

> Selects the next character in the set to be edited. If the program reaches the end of the set, it will wrap around to the beginning of the set.

D Toggles between DRAW and DELETE mode. The current selection is highlighted on the menu.

A Toggles between CHARACTER and ATASCII input mode. The current selection is highlighted on the menu.

E Exits the program. This command leaves the user's character set intact.

M Restores the ROM character set.

Shift I Displays the SAVE/LOAD menu. The character being edited should be stored before using this command.

SAVING AND LOADING

As stated, Shift-I will display the sub-menu for saving or character sets. This has 8 options which are as follows.

Option 1 Saves the entire character set to disk or cassette extension '.FNT'.

Option 2 Saves the entire character set to disk or cassette as BASIC DATA statements. The file will be in LISTed format with the extension '.LST'.

Option 3 Saves all characters which have been altered directly to disk or cassette with the extension '.FNT'.

Option 4 Saves all characters which have been altered as Basic DATA statements with the extension '.LST'.

Option 5 Loads the entire character set from disk or cassette.

Option 6 Loads a partial character set from disk or cassette.

Option 7 Lists the directory of drive 1.

Option 8 Returns to the main editing screen.

A few notes are useful regarding the options. Firstly, the Font Factory includes a routine to validate filenames. It will not allow you to enter filenames that are too long or contain illegal characters. Font Factory filenames do not need extensions as these are automatically added by the program. If you do enter an extension, the program will overwrite it. There are two ways of entering filenames:

1. Just a filename. The program will add the default device specifier ("D:") and the correct extension.

2. Device specifier:filename. The program will use the device specified (if it is valid) and add the correct extension.

Whenever you save a character set, you will be given the option of generating a subroutine to load the set. If the set is saved as Basic DATA statements using options 2 or 4, the loader will be included with the DATA statements, and the program will have the extension of '.LST'. This may be added to any program of your own by ENTERing it and then resaving the entire program. If the set is saved directly to disk or cassette with options 1 or 3, the set will be saved with the extension '.FNT'. and the loader will be saved as a separate file in LISTed format with the extension '.LST'. This subroutine will read the character set from disk or cassette but the DATA will not form part of your program.

It should be noted that if you have saved a partial character set only, the loader will only load the characters which you have altered. The rest of the set will be blank unless you copy the ROM set first into the appropriate part of RAM.

Font Factory really is very easy to use even with a limited amount of programming knowledge. Give it a try, you will be able to give a new look to many of your programs.

AtariLister - requires Java

PROGRAM BREAKDOWN

310-360 - Calls the subroutines to display a character.

370-440 - Converts the 8 decimal values for a character into a bitmap.

450-540 - Converts a bitmap to 8 decimal values.

550-640 - Prints the internal and ATASCII codes for a character.

650-730 - Prints the character grid.

740-810 - Converts an ATASCII code into an internal code.

820-860 - Converts an internal code to an ATASCII code.

870-920 - Gets the 8 decimal values for a character from memory.

930-1040 - Copies the ROM character set into RAM.

1050-1170 - Moves the cursor around the grid.
1180-1210 - Enables the display list interrupts.
1220-1390 - Main loop to read the keyboard.
1400-1510 - Selects a new character to be edited.
1520-1640 - Clears the character grid.
1650-1760 - Restores a single character to it's ROM counterpart.

1770-1890 - Stores an edited character.
1900-1940 - Toggles between DRAW and DELETE modes.

1950-2000 - Draws or deletes a point.
2010-2060 - Toggles between ATASCII and CHARACTER input mode.
2070-2130 - Gets the next character in the set.

2140-2200 - Gets the previous character in the set.
2210-2270 - Calls the subroutine to copy the ROM character set.

2280-2610 - Displays the Input Output menu.

2620-2740 - Asks if a loader routine is required.

2750-2900 - Gets a filename and calls the parsing routine.
2910-3170 - Saves a complete character set to disk or cassette.

3180-3420 - Loads a complete character set from disk or cassette.

3430-3780 - Generates a loader subroutine for DATA files.

3790-3870 - Saves DATA for an entire character set.

3880-3980 - Saves DATA for a partial character set.

3990-4180 - Builds a Basic DATA statement.
4190-4430 - Generates a loader subroutine for DATA statements.

4460-4520 - Sets up the line number for a Basic DATA statement.

4530-4830 - Parses a filename.
4840-5080 - Lists the directory for drive 1

5090-5470 - initialises arrays.
5480-5620 - Sets up the machine code for the display list interrupt.

5630-5920 - Sets up the screen display.

5930-6010 - Exits the program.

 

MAIN VARIABLES

 

CHBASE The location of the RAM copy of the character set.
ST The location of the ROM character set
PAGE The MSB of CHBASE. This value is POKEd into the character set pointer at location 756
CHMAP(8,8) The bitmap of the character.
CHDEC(8) The 8 decimal values of the character.
CHNUM The number of characters altered.
CHALT$ Used to tell the specific characters that have been altered.
ACD The ATASCII code of the character.
ICD The internal code of the character.
AFLAG Flag to indicate whether the program is in CHARACTER or ATASCII input mode.
DFLAG Flag to indicate whether the program is in DRAW or DELETE mode.
LFLAG Flags whether a loader routine is required.
KEY The code of the key pressed.
ML$ The machine code routine to copy the character set.
ML2$ The machine language routine to print the character set to the screen.
DLI$ The display list interrupt routine.
BD$ The Basic DATA statement.
FF$, FL$ Filenames and extensions '.FNT','.LST'.
A,B,C,D,E,L,M are general purpose variables.

 

top