problem with font

Blitz3D Forums/Blitz3D Programming/problem with font

mongia2(Posted 2005) [#1]
font$="fonts\Czar.ttf"
font2$="fonts\arial.ttf"


Font01 = LoadFont(font$,32,1,false ,false)
Font02 = LoadFont(font2$,32,1,false ,false)


setfont font01
text 10,10,"carlo"+Chr$ (255)

setfont font02
text 10,100,"carlo"+Chr$ (255)


waitkey


czar is a russian font

blitz not load a this font!!

thanks
mongia2


big10p(Posted 2005) [#2]
You need to pass LoadFont the internal name of the font, not the file name.

Try LoadFont("czar",32,1,false ,false), assuming "czar" is its internal name.

[edit]I could be wrong on this. It seems you can load a font by giving it's file name and path to the file. I didn't know this. Just specifying an internal name (as I said above) will load an installed font.


WendellM(Posted 2005) [#3]
In my experience, if you rename the .TTF filename to match the internal font name, you can usually load a font in Blitz without having to install it in Windows. For example, if "Example Font" has the filename EXAMPL.TTF, you won't be able to use it in Blitz unless it's installed in Windows. But if you rename it to "Example Font.TTF" then it can usually be loaded by Blitz even if not installed in Windows (though this doesn't work with some fonts).

However, Blitz doesn't work with symbol fonts, so if Czar uses a non-standard encoding, it might not work with Blitz at all.


jfk EO-11110(Posted 2005) [#4]
To get the real font name, doubleclick the font file to start the font viewer system utility. There you can see its name. You will then have to rename it to "real_name.ttf", like WendelIM said.

An other aspect is: there may be path access problems. AFAIK you cannot use a path like "../../fonts/whatever.ttf". Not sure if a simple subfolder works at all. It surely works when the font is inside the apps folder. Or you may try to ChangeDir to the fonts folder, then load it, then ChangeDir back.