font
(0) = _LOADFONT("cour.ttf", 16, "monospace")font
(1) = _LOADFONT("courbd.ttf", 16, "monospace")font
(2) = _LOADFONT("courbi.ttf", 16, "monospace")font
(3) = _LOADFONT("couri.ttf", 16, "monospace")
PRINT "First, I want to showcase the exisinging issue with the _FONT command." PRINT "Let's start out typing something, and then pause before loading a"
COLOR &HFFF00000, &HFFFFFF00 slowprint "NOW WHERE IS OUR PRINT CURSOR AT??"
PRINT "Now, let's try this same type of thing, while using SafeLoadFont" PRINT "We'll start typing something, and then pause before safe loading"
slowprint "Slowly watch what happens to our print cursor "
SafeLoadFont font(1)
slowprint "as we use SafeLoadFont to change "
SafeLoadFont font(2)
slowprint "fonts while happily printing to "
SafeLoadFont 16
slowprint "the screen, without a concern in the world! "
PRINT "Now, isn't that something?!"
'Safely loads a font without destroying our current print location and making it revert to the top left corner.
right
= (right
- 1) * _PRINTWIDTH(" ") 'convert the monospace LOC to a graphic X coordinate right
= (right
/ _PRINTWIDTH(" ")) + 1 'convert the graphic X coordinate back to a monospace LOC column