loading BMP fonts

Blitz3D Forums/Blitz3D Beginners Area/loading BMP fonts

AvestheFox(Posted 2004) [#1]
How do you load you're own BMP fonts into a B3D program?

I'd like to use it for counter and timer reasons.. plus information... but how do I do this?


DNielsen(Posted 2004) [#2]
I believe you use LoadAnimImage()perhaps, where the image file contains seperate frames with each letter in the alphabet, and then you extract the bitmap letter using DrawImage(). In fact, when I read your post I was just about to do this myself!! I am looking for at 15 pixel high bitmap font.


AvestheFox(Posted 2004) [#3]
lol.. funny coincidense ^^

I'm still new to Blitz, even though I've had ownership of the program for 3 years now (finally got time to play around with it)

but anyway.. I'll look into what you told me.. and thanks bunches


CS_TBL(Posted 2004) [#4]
very briefly, because I'm going to zzZ:

image=loadimage("font.bmp")

use drawimagerect to draw parts of it .. (see the help) While parsing a string, use the ascii-value of each character to define the x/y coord in the bmp to draw with drawimagerect ..

(assumingly the font is @ ascii-order)

'ave fun


WolRon(Posted 2004) [#5]
Using the DrawImageRect command as CS_TBL suggested is overkill. Just load your bitmap font with the LoadAnimImage command and then use the DrawImage command like so:
DrawImage image, x, y, framenumber
where framenumber is equivalent to the ascii value of the character you want to print.

I just wrote a function to do this in another thread...
http://www.blitzbasic.com/Community/posts.php?topic=40884


JazzieB(Posted 2004) [#6]
I've written a couple of bitmap routines that are available from my website, if you're interested. Just click on my site link below and then head to Blitz > Functions. There's other stuff there as well.


jhocking(Posted 2004) [#7]
I recommend getting FONText. In addition to the excellent bitmap font creation/display code, you get useful HUD code. But for free try this:
http://www.blitzcoder.com/cgi-bin/showcase/showcase_showentry.pl?id=cyberseth05162003013142&comments=no


Grisu(Posted 2004) [#8]
Or use Seth's Font tool for FREE!
http://www.blitzcoder.com/cgi-bin/showcase/showcase_showentry.pl?id=cyberseth05162003013142&comments=no