Paper No 20: Multiple Fonts in Displayers
R E Thomas
11 December 1975
1. FONT ORGANISATION
The main character tables are stored in the upper bank. These are:
- VCHTAB
- Table of addresses pointing to the first word of a character.
This table is reset on entry to the displayer and is altered whenever a new character code
is set.
- SPCTAB
- This table converts character heights to scope points
and seems independent of the actual font itself.
- CHBOXH, CHBOXW
- Character height and width
(equals 16, 12 respectively for OCRB3 and GPO).
- FONTNM
- Font name (OCRB3 = 16, GPO = 17). This is not used.
- FONTYP
- Indicates whether courier angles are being used or not (OCRB3 = 0, GPO = 40).
- CHSPMN
- (124 for both fonts). This is not used.
- CHSPBS
- (160 for both fonts). This is used in width calculations.
- CHSPMX
- (250 for both fonts). This is not used.
- CHVSTR
- Table of characters, Address of next word past the last one is GHVEND.
Each character is preceded by two words for calculating height and width
for proportional spacing. The first word (which is the address pointed to by the
appropriate entry in VCHTAB) has the character. code as bottom 8 bits.
The character definition then follows.
2. MULTIPLE FONT IMPLEMENTATION
Since the GPO font is the larger of the two, the two modified displayers are:
FRFC and FMFC
The two existing fonts are saved as binary files in MON;FNT1 and FNT2
(OCRB3 and GPO respectively). The system allows for files FNT0 to FNT1.
Each binary file (which has been created either by DEBUG or the Assembler) contains (in order):
CHBOXH
CHBOXW
FONTNM
FONTYP
CHSPMN
CHSPBS
CHSPMX
CHVSTR to CHVEND
The addresses stored in file are NOT significant.
The data will be loaded correctly as long as the consecutive format
specified above is maintained.
Other font files can be generated from the symbolic lists, as long
as the resultant code is no longer than that occupied by the GPO font.
The data format
232000 + N
(which is III select font order) has been implemented in these two displayers.
N defines which font and must lie between 0 and 7
(to reference files FNT0 to FNT7 respectively). The execution of the command is as follows:
- Reset existing VCHTAB and return any space used for user-defined characters,
new character codes, etc.
- Check that space is available above any picture definitions for a disc buffer.
Exit with *DBF if no space.
- Find the specified font file. Exit with *DNF if not found.
- Read new font into core.
- Replace references to CHVEND so that they now point to the new
font table end.
- Reset VCHTAB to the new error character location.
- Set up VCHTAB for the new characters that have been defined.
- Mirror the characters if necessary and set correct font type angles.
- (9) Obey "set character height zero" code so that new proportional space
values can be set.
The user must reset the space and height commands again if the above does not give
the desired height.
3. SETTING UP A FONT FILE
Font files (FNT0 to FNT7) can be set up in three ways:
- Dumped to file from a displayer by loading the displayer and zeroing
all but the desired data:
FRFC$L
0<CHBOXH$$Z
CHVEND<37777$$Z
$J HLT
FNT2$F
- Assembled from a source file containing all the characters.
This could be done from scratch if user-defined characters are used,
but would involve a considerable amount of source input.
- Assembled from a source file, making use of the III source fonts.
The file layout would be as follows: (for FNT1)
/FNT generation
.NAME MON; FNT1 BINARY
/defined set of all character names
/required
CC000l = = 0
CC0002 = = 0
etc
/macro definition for proportional spacing
.DEF ZZ
0
0
.TERM
/insert suitable source file
.INSERT III164 OCRB3
START
In cases 2 and 3, care must be taken to ensure that the font file generated
is no larger than FNT2, so that the font will fit in FRFC.
4. POSSIBLE FUTURE MODIFICATIONS
- The host software packages can be modified to produce the following effects:
- Colour programs call FR rather than FC (since these two arc now identical).
- GPO font requests are for 'C' type displayers.
- OCRB3 font requests are also for 'C' type displayers, but with order 232001
inserted at the start. The routine HFONT would cause this to be issued and would
then come after the graphics initialising routine (and be available anywhere
in the program).
Thus:
Old New
FRFO FRFC with 232001
FRFC FRFC
FCFO FRFC with 232001
FCFC FRFC
FNFO FMFC with 232001
FHFC FMFC
Alternatively, GPO font could become the standard.
This modification would mean that only two displayers would be required for maintenance.
- Further extensions to the character routines could include:
- A III control character to change font so that different fonts could be used
easily in the same line (without specifically resetting the X,Y coordinates).
However, there would be some difficulty in matching character sizes.
- A monitor command to change font could be implemented for stand-alone use of
the displayer. This use is sufficiently infrequent not to make this worthwhile.