; LoadFont Example ; ---------------- Graphics 640,480,0,2 SetBuffer BackBuffer() ; LoadFont(fontname$,height,bold,italic,underlined) returns a font handle title_plain=LoadFont("Arial",48) title_bold=LoadFont("Arial",48,True) title_italic=LoadFont("Arial",48,False,True) title_under=LoadFont("Arial",48,False,False,True) ; A small font for the info overlay info_font=LoadFont("Arial",14) title_font=title_plain desc$="LoadFont(Arial,48) - plain" While Not KeyDown(1) ; Keys 1-4 pick which loaded font draws the title If KeyHit(2) Then title_font=title_plain desc$="LoadFont(Arial,48) - plain" End If If KeyHit(3) Then title_font=title_bold desc$="LoadFont(Arial,48,True) - bold" End If If KeyHit(4) Then title_font=title_italic desc$="LoadFont(Arial,48,False,True) - italic" End If If KeyHit(5) Then title_font=title_under desc$="LoadFont(Arial,48,False,False,True) - underlined" End If Cls ; Draw the title screen with the chosen font, pulsing gently pulse=155+Sin(MilliSecs()/4.0)*100 SetFont title_font Color pulse,pulse,255 Text 320,180,"STAR PATROL",True,True Color 255,255,255 Text 320,250,"press start",True,True SetFont info_font Color 255,255,255 Text 0,0,"1-4: choose font style Esc: exit" Text 0,20,desc$ Flip Wend ; Release the font handles when we are done with them FreeFont title_plain FreeFont title_bold FreeFont title_italic FreeFont title_under FreeFont info_font End