Fonts in Blitz3d

Blitz3D Forums/Blitz3D Programming/Fonts in Blitz3d

Cubed Inc.(Posted 2015) [#1]
Is it possible to load a font straight from a file with Blitz3d, or is the program was stuck with the average defaults?


Matty(Posted 2015) [#2]
Yes.


loadFont()
setFont()


as long as the user has the font installed on their device.....


Cubed Inc.(Posted 2015) [#3]
Ah, I see what I did wrong; I forgot to add the spacing when inputting the font's name.

While this post is still so young, would be so kind as to answer another one of my questions? If someone who doesn't have the specific font installed onto their computer played the game, would the font fail to load and default to ariel? I'm wondering if adding the font files in the game would suffice as a solution; but then again, I'm still not sure.


Matty(Posted 2015) [#4]
I'm not sure...I've not tried it.....but you can give it a go?


Cubed Inc.(Posted 2015) [#5]
Well, the game I'm currently working on is far from complete, but eventually we'll find out.


RemiD(Posted 2015) [#6]

If someone who doesn't have the specific font installed onto their computer played the game, would the font fail to load and default to ariel? I'm wondering if adding the font files in the game would suffice as a solution; but then again, I'm still not sure.


I have done some tests about this a few years ago, from what i remember, you can try to install and to load a custom font, but if it fails, you can use a commonly installed font like arial or verdana...
Not sure if the list of commonly installed fonts has changed over the years, you may want to do a search about recommendations about fonts for html pages or for computers with Windows...


Cubed Inc.(Posted 2015) [#7]
I'll add the fonts used to the game's files and advise players to install them before playing. It's a crude method, but what can you do?


_PJ_(Posted 2015) [#8]
1) Fonts must either be installed and loaded by their NAME (i.e. LoadFont("Arial") OR included with direct path to their correct filename (i.e. LoadFont("C:\Windows\Custom Font Italic.ttf"))

2)If a font is not loaded correctly, even if the handle is not null, the program may still crash.

3) If no Font is Set with SetFont, the default ("Blitz.fon" font is used with a size 10


ShadowTurtle(Posted 2015) [#9]
Alternatively you can render fonts within your gpu instead cpu. Therefore you must use textured bitmap fonts. Search the code archives or project source for examples!


wedoe(Posted 2015) [#10]
Yep, bitmap fonts is the only really safe route :-)