Using Bitmapped fonts

BlitzMax Forums/BlitzMax Programming/Using Bitmapped fonts

I was wondering how to use bitmapped fonts. I would perfer those over ttf fonts.

From what I know bmx already uses bmpfonts.
Each time you load a font, a bmp of it is created.
So you won't gain any increase of runtime speed from it.

My bitmap font module can be found here

http://www.scottshaver2000.com/blitz/bmaxmods/sas.mod.zip

it has the source code.

Strict 
Framework BRL.GlMax2D
Import SAS.bitmapfont
Graphics 800,600,32

Incbin "34-small.png"
Global scrollerFont:BitmapFont = BitmapFont.Create(24, 24, "incbin::34-small", ".png", 0, 0, 0, 1)

Global scrollerFontControl:BitmapFontControl = BitmapFontControl.Create()
scrollerFontControl.sineSmooth=0

HideMouse()

While Not KeyHit(KEY_ESCAPE)
	Cls
scrollerFont.DrawString(scrollerFontControl, 0, 0, "Hello there")
	Flip
Wend





An example of it in use can be found here:

http://www.scottshaver2000.com/blitz/demo5/demo5.zip

Max loads truetype fonts and renders them into a pixmap before uploading (afaik). So you actually draw a bitmap. Would be nice(r) to have ttf fonts load and be turned into polygons for realtime scaling/rotations/distortions.

@Scott:

Your modules are really great!, big thanks.

no problem :)

thank you! this really helped!

so basically you only need a bitmap font function if you don't want to use ttf fonts or you need some extra fancy function I guess.