I modified the above code to load the names of all fonts and pick one at random.
Graphics 640 , 480
SeedRnd(MilliSecs())
Local dir$ = getenv_("WINDIR")+"\fonts\"
Print dir
Local files:String[]=LoadDir(dir)
For t$=EachIn files
Print t
Next
Local fontcount:Int = Len(files)
Print "Number of fonts: "+fontcount
Local random:Int = Rnd(fontcount)
Print "Loading font number: "+random+" called "+files[random]
Local font:timagefont = LoadImageFont(dir+files[random] , 64)
If font
SetImageFont font
End If
While Not AppTerminate()
Cls
DrawText "Hallo" , 100 , 100
Flip
PollSystem
Wend
End
|