Thanks for the memory leak mention, kronholm - I'd never have thought to look out for that in this case. However, the test that I just wrote to check it doesn't seem to show a leak:
Strict
AppTitle = "~q+~q for fast testing, ~q-~q for readable text, ~qEsc~q to quit"
Graphics 640,480
SetBlend ALPHABLEND
Local scale#, oldscale#
Local IFont:TImageFont
Local dly = 5
Local loads
Repeat
Delay dly
Cls
scale = Rnd( 1, 4)
If scale <> oldscale Then
Local FontSz# = 11.0 * scale
IFont = LoadImageFont( "veranda.ttf", FontSz, SMOOTHFONT ) ' your .ttf goes here
If IFont = Null Then Notify( "IFont not loaded", True ) ; End
loads :+ 1
SetImageFont IFont
oldscale = scale
EndIf
DrawText "mem = " + GCMemAlloced() + ", loads = " + loads, 10,10
Flip
If KeyDown( KEY_EQUALS ) Then dly = 5 ' + for fast testing
If KeyDown( KEY_MINUS ) Then dly = 500 ' - to allow reading
Until KeyDown( KEY_ESCAPE )
I left it with auto-garbage collection which I usually use. The memory usage bounces up and down a bit as normal with auto-GC, but it doesn't keep going up and up which would indicate a leak. Do you happen to have an example showing a runaway memory leak when repeatedly reloading fonts?
Update: Hmm, watching memory used in Task Manager tells a whole different story... Keeps going up and up - not good! Looks like there is indeed a leak - good catch. Will you be doing the bug reporting honors, or shall I? :)