4.5.10 Example: Assigning font numbers
Now let’s do aprogram in BASIC. First we’ll assign font numbers to the
Courier and Line Printer resident fonts and to acartridge font, IBM PC
Courier. Then we’ll print samples of each font.
100 LPRINT CHR$(27) ;“(8U”;
110 LPRINT CHR$ (27);“(sOP1Ohl2vOsOb3T” ;
120 LPRINT CHR$ (15);
130 LPRINT CHR$ (27);“*cID”;
140 LPRINT CHR$ (27);“*c6F” ;
150 LPRINT CHR$ (27);“(8U”;
160 LPRINT CHR$ (27);“(sOp16.66h7vOsObOT” ;
170 LPRINT CHR$ (15);
180 LPRINT CHR$ (27);“*c2D”;
190 LPRINT 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 100and llOcallstheintemal Courier font and line 120makes itthe
primary font. Line 130gives it font ID number I, and line 140 makes it
temporary.
Lines 150through 190do the same thing forthe Line Printer font, andlines
200 through240 forthecartridge font. Notice thatthecartridge fonthasthe
IBM symbol setcode 10U.
Lines250through 300printout samples ofthethree fonts. Finally, line310
resetsthedefaultto ourintemal Courierfont, andline320 performsthe final
form feed to print the page.
78