Setting the default Blitz font?
BlitzMax Forums/BlitzMax Beginners Area/Setting the default Blitz font?
| ||
| 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! |
| ||
| 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? |
| ||
| I also have tried getimagefont/setimagefont but without success. That's the point where the wonderfull documentation comes in. *cough* |
| ||
| Anybody know how to use GetImageFont? |
| ||
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 |
| ||
| Thanks Squatting Neville, Is there a 'currentfont' type command which displays the fontname? |
| ||
| I don't think so. |
| ||
| 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! :& |
| ||
| 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()
EndI'm sure you won't be happy until you know that it appears to be Blitz.fon @ 14p (SetImageFont(null) should work too). ;op |
| ||
| That looks good to me. Thanks |
| ||
| 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. |