chapter 9
DOWNLOAD CHARACTERS
With this printer you can create new characters and symbols, download their dot data. and have them printed in place of selected characters in the regular character set. Characters that can be generated in this way range from simple but useful symbols like the check mark through to complex Chinese or
Japanese characters.
Regular characters are permanently stored in the printer’s ROM, but characters you design are downloaded and stored in RAM for use.
Before you start to define your own characters, you must set the EDS switch
A-3 to the OFF position. Otherwise, the RAM is used to store the input buffer, and the download commands are ignored.
DEFINING YOUR OWN CHARACTERS WITH
STANDARD MODE
Designing and printing your own characters has two requirements: first, designing the shape of the character, calculating the data necessary to make the shape, and sending that data to the printer, and secondly, sending the command to print the downloaded characters instead of the regular characters. There are a number of design constraints for download characters:
“ The matrix or grid on which you design the characters depends upon the print mode as shown below:
Character mode
Draft characters
LQ pica characters
LQ elite characters
LQ semi-condesed
LQ proportional
Draft super/subscript
LQ super/subscript
LQ prop. super/subscript
Horizontal
9
31
27
19
37
7
19
37
Vertical
24
24
24
16
24
16
16
16
121
●
The minimum width of a character is five dots.
●
Dots cannot overlap.
● You may define any position in the ASCII table.
Photocopy the grid in Figure 9-1 to help design your new characters. We will use a tiny representation of a telephone symbol for our example.
Figure 9-1.
Use this grid (or one similar to it) to define your own characters.
Assigning the character data
Now, we calculate the vertical numerical values of the columns of dots, and enter them underneath the grid. Each vertical column (which has a maximum of 24 dots) is first divided into three groups (or two groups for super/ subscripts) of eight dots. Each group of eight dots is represented by one byte, which consists of eight bits.
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,
122
128
64
32
64
32
16
8
4
2
1
128
16
8
4
2
1
128
64
32
16
8
4
2
1
1 2 3 4 5 6 7 8 9 101112131415161718192021 22232425262728293031
ASCllCode:
Leftspace:
Characterwidth
Rightspace.
60
3/
2
Figure 9-2. Telephone symbol wtth normal LQplca.
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 if you are not printing them proportionately.
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 mO and 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.
123
When defining characters, the number of printed columns (m1). and the sum of side spaces and the character width (mo + m1 + M) cannot exceed the value shown below’.
Character mode
I
Draft characters
LQ pica characters
LQ elite characters
LQ semi-condesed
LQ proportional
Draft super/subscript L
Sample program
9
31
27
19
37
7
19
37
M + tn1+ m2
12
36
30
24
42
12
36
42
To demonstrate how to use the download characters. let’s use the “telephone” character and the other user-defined characters [o print a small graph. This program will do just that:
1000
1010
1020
1030
1040
1050
1060
1070
1080
1090
1100
1110
1120
1130
1140
1150
1160
1170
1180
1190
1200
1210
1220
1230
1240
1250
1260
1270
1280
1290
1300
1310
1320
1330
WIDTH “LPT1: “ , 25S
LPRINT CHR$ (27) ;
“X 1 “ ;
LPRINT CHR$ (27) : “&” ;CHR$ (0) ;
LPRINT CHR$ (60) :CHR$(61 ) ;
FOR N=60 TO 61
READ LS :LPRINT CHR$ (LS) :
READ CW : LPRINT CHR$ (CW) :
READ RS : LPRINT CHR$ (RS) ;
FOR M= 1 TO CW*3
READ MM
LPRINT CHR$ (MM) ;
NEXT M
NEXT N
LpRINT
(JHR$
(27) ; “D”; CHR$ ( 1 i ) ; CHR$ (0)
LPRINT CHR$ (27) ; “k” :CHR$ (4) ;
LPRINT CHR$ (27) ; “h” ; CHR$ ( 1) :
LPRINT “ DIFFUSION RANGES OF”
LPRINT “ CARS & TELEPHONES”
LPRINT CHR$ (27) ;
LPRINT CHR$ ( 27) ;
“h” :CHR$ (0)
“k” ; CHR$.(0) ;
LPRINT CHR$ (27) ; “%” ;CHR$ ( 1 ) ;
LPRINT “USA” ;CHR$ (9) ;
FOR 1=0 TO 681 STEP 2S
LPRINT
LPRINT CHR$ (9) ;
FOR 1=0 TO 781 STEP 25
LPRINT
LPRINT “GERMANY” ; CHR$ ( 9) ;
FOR 1=0 TO 412 STEP 2S
LPRINT
LPRINT CHR$(9) ;
FOR 1=0 TO 488 STEP 25
LPR I NT
LPRINT “JAPAN” ;CHR$ (9) ;
: LPRINT CHR$ (60) ;
: LPRINT CHR$(61 ) :
:LPRINT CHR$(60) ;
:LPRINT CHR$(61) ;
:NEXT I
:NEXT I
:NEXT I
:NEXT I
1490
1500
1510
1520
1530
2000
2010
2020
2030
2040
2050
2060
2070
2080
1340
1350
1360
1370
1380
1390
1400
1410
1420
1430
1,440
1450
1460
1470
1480
2090
2100
2110
2120
2130
2140
2150
2160
2170
2180
FOR 1=0 TO 347 STEP 25
LPRINT
LPRI?fT
CHR$(9);
FOR 1=0 TO 493 STEP 25
LPRINT
LPRINT CHR$(9); U+-U;
SCALE$=”+-+–H
FOR 1=2 TO 8
LPRINT ‘+-+”
LPRINT CHR$(9); ”0 ‘:
:LPRINT
:LPRINT
:LPRINT
FOR 1=1 TO 8
LPRINT u “;1;
NEXT I
LPRINT CHR$(27) ;’’%U;CHR$(0)
LPRINT CHR$(27); ”M”;
LPRINT CHR$(27) ;USM;CHR$(0);
LPRINT CHR$(9):”(1OO UNITS/1000
CHR$(60);
CHR$(61)
SCALE$;
PERSONS)”
;
:NEXT I
:NEXT I
:NEXT I
LPRINT CHR$(27); ”T”;
LPRINT CHR$(27) ;”@”
END
DATA
Telephone Symbol
DATA “3, 31,” 2
DATA O, 0,
DATA 19, 15,192,
DATA 47.
80.
0, 7, 0,
40, 16,
0.
80.175,192,
DATA 80; 163:192;
DATA 47, 80,
DATA 19, 15,192,
33, 64,
0, 80,175,192,
40, 0,
0 DATA O,
Car Symhol
0,
DATA 3, 31,
DATA
DATA
DATA
O, 0.
0,252,128.
10,
DATA 64,126,
3,
0, 63,128,
0, 64,124,128,
0,
0,
2
0, 0, 30}
0,
0, 20,124,
3, o,
64,
0,
0,
DATA 32, 3,
DATA 76,124,128,
DATA O, 0, 0
51, 3, 0,
0, 8, 0,
0, 80, 47,192,
47.
80,
0, 23, 0,
32, 80,
80,163,192,
32,
23,
80,
0,
0, 80,163,192,
47.
80,
0, &O.
47,192,
0, 8, 0,
0, 0,
1,252,128,
40,
64,126,
0,
0,
0,
2,
60,
0, 80,126,
0, 63,128,
3, 64,
32,
12,252,
3, 64, 64,124,128,
0, 3, 0,
0, 40, 0,
0, 80,175,192
0,
0,
0,
0,
0,
0,
33, 64,
80,175,192
40, 16,
7, 0,
0
0, 3,
5,124,128
32,
64,124,
0,
0
48,
0,254,
3, 64
0
0
0
0
0
0
[]SA
GERMANY
J i4PAN
DIFFUSION RANGES OF
CARS & TELEPHONES
1 ,LJ