4.5.10 Example: Assigning font numbers

Now let’s do a program in BASIC. First we’ll assign font numbers to the Courier and Line Printer resident fonts and to a cartridge font, IBM PC Courier. Then we’ll print samples of each font.

100LPRINT CHR$ (27);“(8U” ;

110LPRINT CHR$ (27);“(sOP1Ohl2vOsOb3T” ;

120LPRINT CHR$ (15);

130LPRINT CHR$ (27);“*cID”;

140LPRINT CHR$ (27);“*c6F” ;

150LPRINT CHR$ (27);“(8U” ;

160LPRINT CHR$ (27);“(sOp16.66h7vOsObOT” ;

170LPRINT CHR$ (15);

180LPRINT CHR$ (27);“*c2D”;

190LPRINT CHR$ (27);“*c6F”;

200 LPRINT CHR$ (27);“(1OU”;

210 LPRINT CHR$ (27);“(sOp10h12vOsOb3T” ;

220 LPRINT CHR$(15) ;

230 LPRINT CHR$ (27):“*c3D”;

240 LPRINT CHR$ (27);“*c6F”;

250 LPRINT CHR$ (27);“lX”;

260 LPRINT “Font 1 Resident Courier”

270 LPRINT CHR$ (27);“(2X”;

280 LPRINT “Font 2 - Resident Line Printer”

290 LPRINT CHR$(27); ’’(3X”;

300 LPRINT “Font 3 Cartridge PC Courier”

310 LPRINT CHR$ (27);“(lX”;

320 LPRINT CHR$(12)

Line 100 and llOcallstheintemal Courier font and line 120makes itthe primary font. Line 130 gives it font ID number I, and line 140 makes it temporary.

Lines 150through 190do the same thing forthe Line Printer font, andlines 200 through 240 forthecartridge font. Notice thatthecartridge fonthasthe IBM symbol setcode 10U.

Lines 250through 300printout samples ofthethree fonts. Finally, line310 resets thedefaultto ourintemal Courierfont, andline320 performsthe final form feed to print the page.

78

Page 86
Image 86
Star Micronics 4111 manual Example Assigning font numbers