This is where the numbers down the left side of the grid come in. Notice that there is a number for each row of dots and that each number is twice the number below it. By making these numbers powers of two we can take any combination of dots in a vertical column and assign them a unique value.

Assigning a value of character space

Besides being able to specify the actual width of the character, this printer allows you to specify the position in the standard grid where the character will print. You must specify the dot column in which the printed character starts and the dot column in which the character ends. Why, you may ask, would you want to define a character this way instead of merely defining the overall width of the character? Because this printer’s proportional character definitions can also be used to print normal width characters, and by centering even the narrow characters in the complete grid they will look good even you are not printing them proportional.

The three bytes are used to specify the width of the character and the space to be allowed on either side of it. The left space (in dot columns) is specified by rnOand the right space is specified by m2. The second byte (ml) specifies the width of the character in dots. By varying the width of the character itself and the spaces around it, you can actually create proportional width characters.

When defining characters, the number of printed columns (ml), and the sum of side spaces and the character width (mO+ml +m2) cannot exceed the value shown below.

Character mode

ml

mO+ml +m2

Pica characters

31

36

Elite characters

27

30

Semi-condensed

19

24

Proportional

37

42

Super/subscript

19

36

Proportional super/subscript

37

42

Sample program

To demonstrate how to use the 24-dot download characters, let’s use the “telephone” character and the other user-defined characters to print a small graph. This program will do just that:

1000 WIDTH “LPT1 : “ , 255

1010 LPRINT CHR$ (27 );“Xl “ ;

1020 LPRINT CHR$( 27) ;“it”;CHR$( O) :

1030 LPRINT CHR$( 60) ;CHR$( 61 );

1FOR N=60 TO 61

1050 READ LS :LPRINT CHR$ (Ls) ;

1060 READ CW :LPRINT CHR$ (CW) :

1070 READ RS :LPRINT CHR$ (Rs );

1080 FOR M=1 TO CW’k3

1090 READ MM

1100 LPRINT CHR$ (MM) ;

1110 NEXT M

1120 NEXT N

Chapter7 DOWNLOAD CHARACTERS 69

Page 75
Image 75
Star Micronics SJ-48 manual Assigning a value of character space, Sample program