Loading fonts

BlitzMax Forums/BlitzMax Beginners Area/Loading fonts

William Drescher(Posted 2008) [#1]
How do I load a font like Arial or something into my blitzmax program? It's alot more complicated that Blitz3D or BlitzPlus.


GfK(Posted 2008) [#2]
How do I load a font like Arial or something into my blitzmax program? It's alot more complicated that Blitz3D or BlitzPlus.
No its not.
LoadImageFont()
SetImageFont()



Grey Alien(Posted 2008) [#3]
Be warned that DrawText is pretty slow though, you may want to think about using Bitmap fonts instead...


William Drescher(Posted 2008) [#4]
I tried that and both Bitmap fonts and regular *.ttf and *.fon kind of fonts dont write correctly at all


grable(Posted 2008) [#5]
You need a relative or absolute path to the font you are loading.

Graphics 320,240, 0

DrawText "Internal Default", 50,40

SetImageFont LoadImageFont( "C:\WINDOWS\Fonts\arial.ttf", 50)
DrawText "Arial 50", 50,60

SetImageFont LoadImageFont( "C:\WINDOWS\Fonts\impact.ttf", 50)
DrawText "Impact 50", 50,120

Flip
WaitKey
That little snippet should look like this on windows


If it doesnt, there could be some graphics/driver problem...