Is there an error condition if LoadFont fails?

Blitz3D Forums/Blitz3D Beginners Area/Is there an error condition if LoadFont fails?

Kale Kold(Posted 2008) [#1]
Is there an error condition if (Text->)LoadFont fails?

for example if a font fails to load does it return 0 instead of a valid handle?


Stevie G(Posted 2008) [#2]
Try it. If the font is not loaded I'm pretty sure is just defaults to Ariel 12pt or similar.


Ben(t)(Posted 2008) [#3]
if loadfont fails it loads the font stevie G said I don't know if it returns a number, I always find if it loaded or not by the text on the screen


Zethrax(Posted 2008) [#4]
Seems it returns a valid non-zero handle on failure, and loads a placeholder font (probably arial) in the size specified, and with the flags specified.

Graphics 800,600
testfont = LoadFont( "k3camcv72kk9l", 16, True, True )
SetFont testfont
Print "Press a key to exit."
WaitKey
FreeFont testfont
RuntimeError testfont