   1 REM Bitmap fonts in NextBasic DMS 2018
   2 REM Requirs fontxx.spr for bitmap data
  10 PROC setup()
 100 PROC font(1,1,"HELLO",1)
 110 PROC font(1,2,"HERE IS A NICE FONT ROUTINE",1)
 120 PROC font(1,3,"WRITTEN IN BASIC THAT USES",1)
 130 PROC font(1,4,"A TILEMAP AND BITMAP FONT DATA",1)
 140 PROC font(1,6,"IT ALSO SUPPORTS MULTIPLE",2)
 150 PROC font(1,7,"FONTS LOADED INTO MEMORY",2)
 160 PROC font(1,8,"FOR THE BITMAP DATA",2)
 170 PROC font(1,10,"FONTS ARE FROM ARCADE FONT",0)
 171 PROC font(1,11,"WRITER.",0)
 180 PROC font(1,13,"TAKE A LOOK AT THE CODE AND",3)
 190 PROC font(1,14,"SEE WHAT YOU CAN COME UP WITH",3)
 200 PROC font(1,16,"BYE",2)
 499 PAUSE 0: LAYER 2,0: LAYER 1,1: STOP 
 500 DEFPROC font(x,y,a$,fnt)
 506  OUT 9275,7: OUT 9531,2
 507  TILE BANK 16+fnt
 510  FOR l=0 TO LEN a$-1
 515   LET li= CODE a$(l+1)-34:   IF li<=0 THEN LET li= 30 
 520   BANK 15 POKE l, li
 530  NEXT l
 540  TILE LEN a$,1 AT 0,0 TO x,y
 560 ENDPROC 
1000 DEFPROC setup()
1010  CLS : LAYER 2,0: TILE BANK 16
1015  PAPER 0 : BORDER 0: CLS 
1017  LAYER 2,1: INK 255 
1020  LOAD "font15.spr" BANK 16,0,4096
1025  LOAD "font7.spr" BANK 17,0,4096
1026  LOAD "font3.spr" BANK 18,0,4096
1027  LOAD "font8.spr" BANK 19,0,4096
1030  TILE DIM 15,0,58,8
1999 ENDPROC 
9997 STOP 
9998 SAVE "bas-fnt.bas" LINE 0 
9999 OPEN # 4,"o>bas-fnt.txt": LIST #4 : CLOSE # 4
