Star Micronics NB-15 user manual n Download character definition command

Models: NB-15

1 114
Download 114 pages 4.7 Kb
Page 105
Image 105
nDownload character definition command

for user-defined characters, but a caution is in order. Characters with ASCII values below 32 are usually reserved as control codes by both your computer and your printer. While these characters can be replaced by user-defined characters, it should be avoided because of the effect on the normal control codes.

In our example, we’ll assign the car a value of 60, which is the code for the character “(” in the ASCII characters. A rather ar- bitrary selection, but this printer doesn’t care!

Our chart would hardly be complete with just a picture of a car, so in Figure 8-8 we’ve made completed grids for some other symbols: a telephone (quite a strange mix of characters!). The in- formation on the grids is now completed.

nDownload character definition command

You’ve read through a long explanation of download characters and we haven’t even told you the command syntax yet! Now the wait is over. This is the most complex command in your printer repertoire and now you’ve got the necessary knowledge to implement it. Here it is:

(ESC) “&” CHR$(O) nl n2 m0 ml m2 dl d2 d3 ... dx

Like the other printer’s commands, it starts with an (ESC) (CHR$(27)). The next character is an ampersand (&) (CHR$(38)) followed by a CHR$(O).

nl and n2 are used to specify the ASCII values of the characters you are defining. The reason that there are two bytes reserved for this is that your printer allows you to define many characters with just a single command. nl is used to specify the beginning of a range of characters to be defined; a.2 specifies the end of the range. For instance, if you wanted to change the ap- pearance of the numerals from 0 to 9 (which have ASCII codes 48 through 57), the command would begin with (ESC) “&” CHR$(O) CHR$(48) CHR$(57) ... Of course, you can also define individual characters by making nl and n2 equal.

The three bytes following the specification of the range of characters (m0, ml and m2) 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 column) is specified by m0 and the right space is specified by m2. The second byte (ml) specifies the number of columns of dots that will be printed by the character. By vary- ing the width of the character itself and the spaces around it, you can actually create proportional width characters.

Page 105
Image 105
Star Micronics NB-15 user manual n Download character definition command, ESC “&” CHR$O nl n2 m0 ml m2 dl d2 d3 ... dx