Setting the default Blitz font?

BlitzMax Forums/BlitzMax Beginners Area/Setting the default Blitz font?

Grisu(Posted 2005) [#1]
Hallo everyone,

I need to reload the default Blitz font to be used with Drawtext. Does someone know what the name of the font is (+size,+style) so I can use it with Loadimagefont?

Ty!


tonyg(Posted 2005) [#2]
If you know how to run the getimagefont command then I'm happy to try it here.
I have no idea how to convert a TimageFont return to something which I can print.
p=getimagefont results in p=1 which, I assume, is the first object.How do I get information on it?


Grisu(Posted 2005) [#3]
I also have tried getimagefont/setimagefont but without success.

That's the point where the wonderfull documentation comes in. *cough*


tonyg(Posted 2005) [#4]
Anybody know how to use GetImageFont?


Yan(Posted 2005) [#5]
This works for me...
Graphics 640, 480, 0

Local DefaultFont:TImageFont
Local NewFont:TImageFont

DefaultFont = GetImageFont()
NewFont = LoadImageFont("c:/windows/fonts/Arial.ttf", 20)'For demonstration purposes only ;o)

SetImageFont(NewFont)
DrawText "This is ~qArial~q", 10, 0

SetImageFont(DefaultFont)
DrawText "This is ~qBlitz~q", 10, NewFont.Height()

Flip

WaitKey()

End



tonyg(Posted 2005) [#6]
Thanks Squatting Neville,
Is there a 'currentfont' type command which displays the fontname?


Yan(Posted 2005) [#7]
I don't think so.


Grisu(Posted 2005) [#8]
I still have my problem, when switching between gfx-modes in runtime, the imagefont is destroyed. So I nead to "reload" it, but dont know what parameters to use....
Using Setimagefont is NOT enough! :&


Yan(Posted 2005) [#9]
Eh?

When you switch graphics modes the font is reset to the default!...
Graphics 640, 480, 0

Local NewFont:TImageFont = LoadImageFont("C:/windows/fonts/arial.ttf", 20)

SetImageFont NewFont

DrawText "Hit A Key...", 10, 10

Flip
WaitKey()

Graphics 640, 480, 0

DrawText "Hit A Key...", 10, 10

Flip
WaitKey()

End
I'm sure you won't be happy until you know that it appears to be Blitz.fon @ 14p (SetImageFont(null) should work too). ;op


tonyg(Posted 2005) [#10]
That looks good to me. Thanks


Grisu(Posted 2005) [#11]
Have sent Neville a link to my full souce code and media. Perhaps he can find my mistake?

- This is the craziest stuff I ever encountered.