Will blitz ever be able to load its own font ???

BlitzPlus Forums/BlitzPlus Programming/Will blitz ever be able to load its own font ???

skn3(Posted 2003) [#1]
Will blitz ever be able to load the 'blitz' font ?

Try doing it, it wont work. Seems kind of strange !!


WendellM(Posted 2003) [#2]
If you mean the font it uses when no font is loaded, just free whatever you're using:
Graphics 800,600,16
Big=LoadFont ("Arial",40)
SetFont big
Text 10,10,"foo"
FreeFont big
Text 100,100,"bar"
WaitKey

If you mean blitz.fon, I don't think that Blitz can load anything but TrueType fonts. Blitz.fon looks to be what the IDE uses (and since it's a bitmapped font, it doesn't scale well as you can see by double-clicking on it, so you probably wouldn't want to use it anyway).


Shagwana(Posted 2003) [#3]
You will find the Blitz.fon in the cfg folder of your blitz install (2d and 3d). To use it you can either copy it to your fonts folder or to the base folder of your project.


skn3(Posted 2003) [#4]
wtf..
without meaning to be rude, I am not an idiot.

font=LoadFont("Blitz.fon",15,True,False,False)

mywin=CreateWindow("blah",50,50,200,200,0,1)
mytext=CreateTextArea(0,0,200,200,mywin)
SetTextAreaFont(mytext,font)

Repeat
	Select WaitEvent()
		Case $803 : End
	End Select
Forever

Above code will not load in the blitz font.

This is the Plus forum I posted in :) (not beginner)


Floyd(Posted 2003) [#5]
The font has to be where your program can find it.
Other than that it works just fine.

font=LoadFont("Blitz.fon",15,True,False,False)

DebugLog "font = " + font   ; Did the font load?

mywin=CreateWindow("blah",50,50,200,200,0,1)
mytext=CreateTextArea(0,0,200,200,mywin)
SetTextAreaFont(mytext,font)

AddTextAreaText mytext, "One"

AddTextAreaText mytext, Chr(10) + "Two"

Repeat
	Select WaitEvent()
		Case $803 : End
	End Select
Forever



skn3(Posted 2003) [#6]
Lol as I said in #blitzbasic, you need to give me more credit lol.

Anyway, yeah I probably should have said, that code example i tried with the font in the same folder (obviously)


skn3(Posted 2003) [#7]
Well i figured the problem.
font=LoadFont("Blitz.fon",14,False,False,False)
doesn't work.

font=LoadFont("Blitz",14,False,False,False)
does

soo er, that is a weird problem, from something i read near to when i was first learning blitz, i always presumed that a font being used from the same dir as your program, required a file extension.

heh sorry to cause anyone any excess finger motions to respond to my lame posting...


DarkEagle(Posted 2003) [#8]

wtf..
without meaning to be rude, I am not an idiot.




*cough*
*ahem*

;) lol


Mark Tiffany(Posted 2003) [#9]
There is a 'known' bug in the current release whereby fonts aren't picked up from the current directory, only if they're installedas windows fonts. So, in a way you're all right - Blitz CAN only load fonts that it can find, and the current version can only find them if in fonts dir. ;-)


skn3(Posted 2003) [#10]
lol it was not me being an idiot... ohnest