fontlib
BitMapOutput sends the output of Print and NPrint to a bitmap
instead of a window, which makes text possible in Blitz mode, where
windows cannot be used. The text is drawn with a BlitzFont, a Blitz
object numbered from 0 that holds a font of 8 by 8 pixel characters.
BlitzFont 0 is the system’s topaz font from the start; LoadBlitzFont
loads others. Colour sets the colours of the text, and Locate,
CursX and CursY set and read the cursor position, in characters.
BLITZ
BitMap 0,320,256,2
BitMapOutput 0
Colour 1,0
Locate 2,1
Print "Score: ",scoreBitMapInput lets Edit$ and Edit read a line on the bitmap as
well, with a cursor; it needs BlitzKeys On for the keyboard in Blitz
mode.
Characters outside the range the font has, and text below the bottom of the bitmap, are not drawn. At the right edge of the bitmap the text goes on in a new line.
Based on the fontlib guide by Acid Software.
Library number 142. It manages BlitzFont objects, by default at most 4 (the compiler options set the maximum).
Commands
BitMapInput
Makes Edit$ and Edit read their line on the output bitmap, with a cursor and the keys left, right, backspace, delete and return. The characters come from the input used before, normally the keyboard with BlitzKeys On. Blitz mode only.
Statement. No help text.
No arguments.
Use BitMapOutput before it. The line is returned without the spaces
at its end. Kept from the original: when the input before ends, the
editor waits forever
(#151).
BitMapOutput
Sends the output of Print and NPrint to the bitmap given, drawn with the used BlitzFont from the bitmap’s cursor position.
Statement. Help text: Bitmap#
Arguments: .w
Each bitmap keeps its own cursor position. As in the original, a
bitmap without bitplanes makes the output run very long; with runtime
error checking, BitMap and CludgeBitMap refuse to make one
(#149).
BlitzFont
The object of an 8 by 8 font for text on bitmaps, as the introduction describes.
Object name. No help text.
Colour
The colours of the text on bitmaps, Foreground Colour for the characters and Background Colour, if given, for the space around them.
Statement. Help text: Foreground Colour[,Background Colour]
2 forms:
.w.w, .w
The colour numbers are those of the bitmap; which colours they show depends on the palette of the slice (Blitz mode) or the screen (Amiga mode) that shows it.
CursX
The column of the cursor of the bitmap output, in characters, where the next character printed appears.
Function, result .q. No help text.
No arguments.
CursY
The line of the cursor of the bitmap output, in characters, where the next character printed appears; it can have a fraction after a Locate with one.
Function, result .q. No help text.
No arguments.
LoadBlitzFont
Loads a font of 8 by 8 pixel characters, such as topaz.font, from FONTS: into a BlitzFont object, which becomes the font of the bitmap output. Amiga mode only.
Statement. Help text: BlitzFont#,Fontname.font$
Arguments: .w, $
Only fonts of 8 pixels height with all characters 8 pixels wide are accepted; any other font, or one that cannot be found, is the error “Can’t Open Font”, also without runtime error checking. A font refused for its size is closed before the error.
Locate
Moves the cursor of the bitmap output to column X and line Y, in characters from 0. Y may have a fraction, for example 1.5 for a line and a half down.
Statement. Help text: X,Y
Arguments: .w, .q