Example: Assigning font numbers

Now let’s do a program in BASIC. First we’ll assign font numbers to the

Courier and Presigeresidentfontsandto a cartridgefont,IBMPC Courier. Then we’ll print samplesof each font.

100LPRINTCHR$(27) ; “ (8U” ;

110LPRINTCHR$(27 ) ; “ ( sOp10h12vOs Ob3T” ;

120LPRINT CHR$( 15) ;

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

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

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

160LPRINT CHR$(27) ; “ (sOp12h10vOsOb8T” ;

170LPRINT CHR$(15) ;

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

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

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

210LPRINT CHR$(27) ;’’(soplOhl2vOsOb3T’” ;

220LPRINT CHR$(15);

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

240LPRINT CHR$(27); ’’*C6F” ;

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

260LPRINT “Font 1 - Resident Courier”

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

280LPRINT “Font 2 - Resident Prestige”

29Q LPRINT CHR$(27); ’’(3X” ;

300LPRINT “Font 3 - Cartridge PC Courier”

310LPRINT CHR$(27); ’’(1X” ;

320LPRINT CHR$(12)

Line 100and 110 calls the internalCourierfontand line 120makes itthe pnmaryfont. Line 130 gives it font ID number l, and line 140 makesit temporary.

Lines 150through190dothe samethingforthePrestige fon~andlines200 through240forthccartridgcfont NoticethatthccartridgefonthastheIBM symbolset code 10U.

Lines250through300printout samplesofthethreefonts.Finally, line310 resetsthedefaulttoourintemal Counerfont,andline320performsthefinal form feed to printthe page.

84

Page 92
Image 92
Star Micronics 8 Series manual Example Assigning font numbers, LPRINTCHR$27 8U