Changing text back

Hello! So I understand that if you use the following, you will change the style of text that basic uses:

DIM v(1)
LET fn$ = "Cuckoo"
LET fs$ = "Bold"
LET v(1) = 50
CALL Object (2, 0, "FONT NAME|FONT STYLE|FONT SIZE", fn$ & "|" & fs$, v())
SET COLOR "magenta"
PRINT "Happy Birthday!"

However, does anyone know how to get basic to go back to its original font and text size after a line or two of the chosen font?

Thanks, and have a great day!

-WellHelloThere

Comments

re: resetting fonts

This whole process is a little easier if you have and use the truectrl.trc library (sure it comes with gold, probably with silver, but not sure about bronze.)

First of all the call to set fonts is a little easier

Call TC_Win_Setfont (window id, fontname$, fontsize, fontstyle$).

What you first need to do is use TC_GetSysInfo to collect the FONT NAME, FONT STYLE, and FONT SIZE before any changes, then you can store these as variables and restore the font using the expression above. See the chapters on Object Subroutines (Ch 19 in my manual) and Interface Library Routines (Ch 22) for more details.

You can probably do all this with object subroutines, but it is easier to use TC_GetSysInfo to collect all the parameters you want.

rwt