Font-setting problem...

Blitz3D Forums/Blitz3D Beginners Area/Font-setting problem...

Cp(Posted 2008) [#1]
Hi. I set any font, and the font it shows is always the same. I don't know why, could somebody tell me? i do this at the beginning of the program:
font = loadfont("fontname.ttf",23,false,false,false)
setfont font



GIB3D(Posted 2008) [#2]
Dont put the extension .ttf
try
font = loadfont("Arial",23)
setfont font


Cp(Posted 2008) [#3]
Didnt work


Cp(Posted 2008) [#4]
Please, i dont know how to do this!!!!
HELP!


Gabriel(Posted 2008) [#5]
You probably need to set a graphics mode before loading a font.


Warner(Posted 2008) [#6]
Some fonts cannot be loaded. You'll need to check if the variable font returns a valid handle (non-zero) or not.
font = loadfont("fontname.ttf",23,false,false,false)
print font
if font <> 0 then setfont font

If it doesn't load, 'font' will be zero, and most likely, the font is not compatible. In that case, use JuicyFonts to convert the font to a bitmap font.
http://juicyfonts.mysite.wanadoo-members.co.uk/


Cp(Posted 2008) [#7]
I did set graphics, thats a code snippet of what i do
juicyfonts doesnt work, x,and y coord are messed up


Warner(Posted 2008) [#8]
Well, juicyfonts seems to have a dialog that allows adjusting that: link
You might be able to fix it with that.


Cp(Posted 2008) [#9]
Erm... Its just a screenshot link?
There is no link for instructions on that...
so... do I change the kerning?(thats all I can gather from the screenshot......)


Warner(Posted 2008) [#10]
Well, juicyfonts or not, if the font doesn't want to load with LoadFont, then basically you'll need a bitmap with all the characters in a matrix that you can load using LoadAnimImage. You could even make one in paint, if nothing else works.


Ross C(Posted 2008) [#11]
The best way is to go into the windows font folder, and check the EXACT spelling and case of the letters.

Can you show us the exact code you are using. The code after it as well, just incase something else is happening.


Cp(Posted 2008) [#12]
Err...Its rally pong, so no.
But it doesnt do it just for that prog,ALL progs.
Example:
font = loadfont("fontname.ttf")
setfont font
text 0,0,"This is a test"



Ross C(Posted 2008) [#13]
Global font = LoadFont("Arial black")
SetFont font

Text 0,0,"HELLO"

WaitKey()


Try running that on it's own. Make sure you have the latest blitz (1.99)


Cp(Posted 2008) [#14]
Never mind, it has to be the exact name it is in windows. I didnt think of that. Thanks Ross C and everybody.

:)
(Could a mod close this? Problem fixed.)