Contact us Heritage collections Image license terms
HOME ACL Associates Technology Literature Applications Society Software revisited
Further reading □ Contents1. Introduction2. Definition of regions3. Line drawing4. Character typing and plotting5. Control procedures7. Extended facilities10. References
ACD C&A INF CCD CISD Archives Contact us Heritage archives Image license terms

Search

   
ACLLiteratureICL 1906A manualsGROATS
ACLLiteratureICL 1906A manualsGROATS
ACL ACD C&A INF CCD CISD Archives
Further reading

Contents
1. Introduction
2. Definition of regions
3. Line drawing
4. Character typing and plotting
5. Control procedures
7. Extended facilities
10. References

Chapter 4: CHARACTER TYPING AND PLOTTING

4.1 THE GROATS CHARACTER SET

There is a set of 64 hardware characters available on the SC4020 which may be plotted at any raster position of the plotting area. In addition to plotting a character at a specified position, it is possible to type strings of characters on the plotting area. This could, of course, be done by several calls of the plotting operation. However, as it is likely to be required frequently, the SC4020 has special hardware for simulating the action of a typewriter. Once in this typewriting mode, the hardware will automatically increment the typing position after each character is typed so that there is the correct spacing between it and the following character. In addition, the hardware automatically moves to a newline when the right hand margin is reached and the top of the page when the last line has been typed. This is the most efficient method of generating textual information on the SC4020 but does not fit easily into the GROATS system. For example, the GROATS system is designed around the concept of regions and any automatic newline facility should return to the left of the selected region rather than the complete plotting area. Consequently, the GROATS system does not make use of the automatic newline or top-of-page hardware. Instead checks are inserted to ensure that all typing appears on the plotting area. If typing goes outside the boundaries of the selected region then it is ignored assuming the region is contained. The rules for typing being visible are as defined in Chapter 2. However the hardware typing orders can cause a large compression of the information required by the SC4020. Therefore the GROATS package uses these special orders when typing hardware characters away from the edge of the plotting area. In the typing mode, two of the 64 hardware characters have special significance as they can be used to change the SC4020 from typing mode to plotting mode (these are the characters having SC4020 internal number in octal: 12 and 56). To avoid confusion the GROATS package has decided not to allow these two characters in either the typewriting or plotting mode. A third character, the plotting dot (octal 52) is also not available in typing mode. However, as it is probably the most important plotting character, it has not been eliminated from the set of GROATS characters. Instead the user must take care not to use the plotting dot in typing operations.

The basic set of hardware characters available on the SC4020 is too restrictive for most requirements and so it has been augmented by a set of software characters made up of short vectors. The main objections to the hardware set are that only a fixed size of about 0.1in in height is available and the lower case alphabet is not provided. The internal numbering of the characters is also not very useful as it bears little resemblance to the 1900 internal code in which Algol strings are stored. Consequently the GROATS package has defined a set of 256 characters with its own numbering system, so that, as far as the user is concerned, there is a 256 character set. The user need not concern himself with the difference between hardware and software characters: the GROATS package will attempt to use hardware characters wherever possible.

Character size and spacing are defined for each region independently so that it is possible to have different character sizes for each of the regions defined. When the units to be used in a region are defined by a call of the procedure 'limits', several typing parameters for that region are automatically initialised. In particular the size of characters defined for that region is set to the standard hardware size. Consequently, unless one of the character procedures is called, the user will automatically use hardware characters wherever possible. The hardware character size is taken as one of the standard sizes of characters in the system. It is possible to redefine character size by defining the height and width required for the characters. This is achieved by calling:

character size (HEIGHT, WIDTH);

The height and width are defined in terms of units of the selected region. As the limits of the selected region are changed, the size of characters will also change on the plotting area. In order that the user may keep the size of characters constant, he may call:

hardwaresize;

All regions have character settings initialised to this and characters will be printed this size eVen though the limits of the region are altered.

A second method of defining a character size independent of the reglon is by calling:

character factor (N);

This will cause the characters to be printed N times as large as the standard size for the character font.

Each character is automatically surrounded by an area which will separate it from neighbouring characters in both the horizontal and vertical directions. The character size is defined as HEIGHT units above and below the line upon which the character sits and WIDTH defines the width of the character with sufficient space between it and its neighbour. It is possible in text editing that the amount of space allowed between characters may need to be decreased or increased. This can be arranged by calling:

character space (X);

This inserts an extra space of X units between characters In the horizontal direction.

4.2 PLOTTING CHARACTERS

To plot the GROATS character numbered N at the point (x,y), the user calls:

plot (x, y, N);

The character is plotted so that the centre of the character is approximately at the point (x,y). For example:

limits (0, 0, 2, 2);
plot (1,1,95);

will plot the 'plotting dot' at the centre of the selected region. The plotting dot is carefully positioned so that it is positioned accurately at the point requested. Most of the hardware and software characters take up several raster positions in height and width so that it is not too obvious where the centre of the character is positioned. In the case of the hardware characters, these tend to be positioned so that the centre of the character corresponds with the plotting position. The main exception is the 'degree' character (GROATS number 94) which is considerably offset. Hardware symbols which appear to be centred accurately are +, -, 0, *. These therefore make good plotting characters. Some of the software characters (especially the lower case alphabet) are considerably offset and should therefore not be used if accurate plotting is required.

If the same character is to be plotted at several different points then the procedure call:

plotn (x,y);

can be used. This plots at the point (x,y) the same character used in the last call of the procedure:

plot (x,y,N);

Alternatively, the character to be plotted in calls of 'plotn' can be defined by:

set plot char (N);

For example, the three programs:

plot (1,1,95); 
plot (1,2,95);
plot (1,1,95);
plotn(1,2);
set plot char (95);
plotn (1,1); 
plotn (1,2);

are all equivalent.

The definition of 'last plotted character' is not linked to the selected region but is global to the region selection commands.

There is also a facility to plot individual characters with a specified intensity: the procedure call

plot intensity (x,y,N,I);

causes the character N to be plotted with intensity I at the point (x,y). For this procedure, N must be the SC4020 hardware character number : software characters may not be plotted by this procedure. There are sixteen levels of intensity, numbered from 0 (the lightest) to 15 (the darkest). The operation of this command does not affect the intensity for other plotting as determined by a prior 'expose heavy' or 'expose light' command.

4.3 TYPING

Before any typing may be done in a region, it is necessary to set the current typing position. Once this has been done, any typing command will cause typing to take place starting from this position. The simplest method of setting the current typing position is to call:

move type to (x,y);

where the position (x,y) is defined in the units of the currently selected region. The typing position corresponds to the centre of the next character to be typed. In order to start typing from the top left hand corner of the selected region, call:

move type to top;

The typing position is set so that the first character typed remains within the boundaries of the selected reglon.

To adjust the typing position by moving on one position call:

increment type position;

This is equivalent to typing a space. Several spaces can be left between characters typed by calling:

type blanks (I);

To reset the typing position to a newline call:

type newlines (I);

If I = 0 the typing position is reset to the left hand edge of the selected region but the Y-coordinate of the current typing position is not altered. In both the procedures with argument I, the user is allowed to use negative or fractional values as argument with the obvious meaning.

Once the typing position has been set, single characters may be typed by the call:

type (N);

which types the GROATS character number N at the current typing position and moves the typing position one position to the right. The amount that the typing position is incremented obviously depends on the current settings of the various parameters associated with size of characters and distance between them. The procedure 'type' may be useful in some circumstances but it is more likely that strings of characters will require typing in which case the procedure 'type string' (to be described later) will be used.

To output a number starting at the current typing position, a procedure 'type number' is provided. This is based on the ICL 'print' output procedure. Calling:

type number (A,I,J);

will output the number A with I places before the decimal point and J places after. The special cases when J = 0 or I = 0 are used to define integer and floating point output formats.

In order to obtain suffices and superfices, procedures are provided which automatically adjust the current character size and typing position. For example:

type (33); 
superfix; 
type (18);
super return;
type (34);
suffix ;
type (10);
suf return; 
type (35);

will type A2B3C

Only a single level of using these procedures has been given in the example. However, there is no reason why a superfix of a superfix or a suffix of a suffix or any other combination should not be typed. The standard procedure for typing strings of characters is:

type string (I);

This types the string of characters whose position is defined by the integer I. This procedure could have been defined with the string of characters as the argument but it is more flexible in Algol to access the string indirectly. The position of a string of characters is obtained by

I:= pointer('ABCD');

The procedure 'pointer' sets I to the address of the string 'ABCD'. Typing the string can then be done by calling

type string (I);

or alternatively

type string (pointer( , ABCD ' ) ) ;

In order to allow strings of characters to be read as data and accessed by the type string procedure, we have:

read string (A, IMIN, IMAX, STR);

The fourth argument, STR, of this procedure is a string consisting of two characters. All characters on the currently selected input are read and ignored until the first of these two characters appears. The input string is then read into the one-dimensional array A starting at A[IMIN] until the second of the two characters appears on the input stream. The two characters themselves are ignored and, after the procedure call, the input pointer is to the character after the terminating character for the read. On exit from the procedure, IMAX is set to the next available location in the array A. This enables several input strings to be stored next to each other in the array. The array elements each contain four characters and two extra words of the array are used to contain the string header. For example, if the input stream is:

rubbish C this is the required string X more ..

and the procedure call is:

j:= 200;
read string (A, 1, j, 'CX');

then 'this is the required string' is stored in A[1] onwards.

To use this stored string in the procedure 'type string' it is necessary to be able to define its position and this can be done by:

I: = addr (A, IMIN);

which sets I to the position of the string stored in A[IMIN] onwards. For example the string read in above could be output by:

type string (addr(A,1));

One problem with the procedure 'read string', as defined, is that the only characters accessible to it as arguments are those which can be read in from data streams or stored as strings in the body of the program. The Algol system only allows those characters which have 1900 internal code values to be accessed in this way: this is restricted to the 64 character set of the lineprinter. Consequently, some method must be provided for typing the remaining characters of the GROATS character set. This is done by calling the procedure:-

displacement is (M) ;

After the call of this procedure, any typing instruction referring to character N will be assumed to refer to character numbered M+N.

For example:

displacement is (64) ;
type string(pointer(' ABC')) ;

will cause the characters 'abc' to be printed instead of 'ABC'. GROATS numbering of the two alphabets differs by 64.

Even so, this global setting of the displacement can be too inflexible and it would be more convenient to be able to change the displacement in the middle of the string in some cases.

This is achieved in the GROATS system by the ability to redefine any character in a string as a setting procedure. Once this has been done the corresponding setting procedure will be called each time this character is encountered in a string instead of typing the character. The possible procedures that may be called in this manner are:

  1. displacement is (I) ;
  2. 2 displacement is (-I) ;
  3. superfix;
  4. super return;
  5. suffix;
  6. suf return;
  7. type blanks (I) ;
  8. type blanks (-I) ;
  9. type newlines (I)
  10. type newlines (-I);
  11. move type to top;
  12. thick (I);
  13. dark (I) ;
  14. overtype;

A character is replaced by a setting procedure by:

define char as special (N,J,I);

which replaces the GROATS character N appearing in a string to be typed by a call of the Jth setting procedure in the above list. For example:

define char as special (33,1,196);
define char as special (34,3,0);
define char as special (35,4,0);

will replace A by a call of the procedure:

displacement is (196);

while B and C will act as the commands superfix and super return.

Calling the procedure:

type string (pointer ('DB2CAD'))

would produce: D2δ

It is possible that other setting procedures will be added to the above list as the need arises. This use of spare characters for defining 'carriage operations' of a typewriter, it is hoped, will greatly increase the flexibility of the typing commands.

4.4 VARIABLE AND CONSTANT TYPE SPACING

The standard method of typing characters in GROATS is to space them such that the distance between the centres of any pair of adjacent characters on the line is constant. Since, for example, the letter I is very much narrower than the letter M, the space between the letter I and its neighbours in a word appears to be much greater than for the letter M - ie the spacing between the characters varies although the centres of the characters are the same distance apart.

The option has therefore been provided to allow users to type characters so that the space occupied by each character varies, depending on the width of the character: in this mode, the spacing between the characters appears constant (and equals the value set by the last call to 'character space' in the selected region) whereas the distance between the character centres varies.

This second, variable character width, mode is entered by the procedure call

constant width (false);

after which all typing in all regions will be with variable character widths.

By calling

constant width (true);

the user may return to the normal constant character width (and hence variable character spacing) mode.

4.5 TYPING BACKWARDS

Certain languages, such as Persian, are written from right to left: to aid the typing of such languages, a facility for typing backwards has been introduced. By calling

type backwards (true);

all typing in all regions will be from right to left: this affects the operation of all procedures which alter the horizontal typing position, namely:

increment type position 
move type to top 
type 
type string 
type number 
type blanks 
type newlines 
suffix 
suf return 
superfix 
super return

By calling

type backwards (false);

the user may return to the normal left to right typing mode.

4.6 OVERTYPING

During a call to 'type string' it is possible to have one character typed over (ie typed in the same position as) another: this has applications to quantities such as accents (where the accent is defined as a separate character to be typed over another character) or some special characters in a language such as Persian.

The procedure to do this, overtype, may only be called via a setting character in a call to 'type string', as follows:

if N 1S the GROATS number of the character Q say, then the call

define char as special (N,14,0);

made, with the result that in the call

type string (pointer ('PQR'));
the character R will be typed over the character P. Note the result of:

type string (pointer ('PQQR'));

ie 'overtype of overtype' is indeterminate and should not be used; this restion also applies to calling 'overtype' directly.

4.7 CHARACTER FONTS

The standard software character font is called FONT 0. This font is provided automatically with the GROATS package and has a basic size 20 × 10 raster units (this is approximately hardware size). It is made up of single straight lines and over expansion of its simple character forms make them appear thin and inelegant. Five additional character fonts are available. Three of these, fonts 1, 2, 3, correspond to those defined at Bell Telephone Laboratories and described in a paper 'Three fonts of computer drawn letters' by Matthews, Lochbaum and Moss in CACM, 10, 10 (Oct 1967) 627-630. These fonts are much more elegant than the standard font 0 and can be used for high quality textual output. The fourth font, font 4, is a Helvetica font: it is an open font - that is, for example, the letter A appears as:

Open Font

This font is particularly useful for titles in film.

The remaining font is available to the user (as font 5): it is at present identical to font 0, but may be redefined by the user.

Each region is initially associated with font 0. The selected region will have all characters plotted as characters from font I if the call

font(I);

is made after selecting the required region, but prior to issuing the plotting (or typing) orders.

The standard size of each of the character fonts - that is the size obtained by calling

character factor (1);

is:

FONT 0 FONT 1 FONT 2 FONT 3 FONT 4
width of character 10 18 28 36 32
height of character 10 12 18 25 32
x coordinate of centre 5 9 14 18 16
y coordinate of centre from top 5 6 9 12 16

The measurements are in raster positions.

⇑ Top of page
© Chilton Computing and UKRI Science and Technology Facilities Council webmaster@chilton-computing.org.uk
Our thanks to UKRI Science and Technology Facilities Council for hosting this site