TBitmapFont - Free Bitmap Font Engine

BlitzMax Forums/BlitzMax Programming/TBitmapFont - Free Bitmap Font Engine

maverick69(Posted 2007) [#1]
Hi,

I have created a small BitmapFontEditor and some easy to use BitmapFont classes for Blitzmax.

Here is a screenshot of the editor/converter:



You can download and use it for free here:

http://www.intermediaware.com/index.php?id=295

It's very easy to use, here is some example source:

SuperStrict

Import "BitmapFont.bmx"

Graphics(800,600,0,60)

SetBlend (ALPHABLEND)

Local MyFont:TBitmapFont = New TBitmapFont
MyFont.Load("fonts/micross_30.fnt")

While (Not KeyDown(KEY_ESCAPE))
	Cls
	MyFont.Draw("Hello World!",MouseX(),MouseY(), True)
	Flip
Wend

End



Who was John Galt?(Posted 2007) [#2]
Hey thanks Maverick. I may end up using this.


computercoder(Posted 2007) [#3]
This is very cool. Thanks for sharing :)


plash(Posted 2007) [#4]
Thanks for this, BTW you should call it TPNGFont :P

EDIT: I've found that if you want to change the font size manually you have to click the italic or bold check buttons to update the canvas, so I added a button to update it, just thought I'd share..

NOTE:This is a modification of BitmapFont_Creator.bmx.

At line 78 Char 42, add:
, btnupdate:TGadget


At line 92 Char 3, add:
btnupdate = CreateButton("Update",530,267,55,21,MainWindow)


At line 122 Char 23, add:
Case btnupdate
	If i>-1
		fileName=fontPath+GadgetItemText(lstFontNames,i)
		iFont=LoadImageFont(fileName,TextFieldText(tbFontSize).ToInt(),style)FontWindow.OffsetY = 0
		SetSliderValue(FontWindow.SliderV,0)
		RedrawGadget(FontWindow.Canavas)
	EndIf



maverick69(Posted 2007) [#5]

I've found that if you want to change the font size manually you have to click the italic or bold check buttons to update the canvas, so I added a button to update it, just thought I'd share..


If you double click the font size it should update automatically.


plash(Posted 2007) [#6]
If you double click the font size it should update automatically.
Not if I am manually typing in the font size in the textfield..


degac(Posted 2007) [#7]
Thank you very much!


Brucey(Posted 2007) [#8]
Hey, this is nice. :-)


maverick69(Posted 2007) [#9]
@Plash:
Okay, you're right. I will fix this bug as soon as I'm back from my hollidays in one week :-)


Sledge(Posted 2007) [#10]
Ow! Can someone compile the font creator for those of us without MaxGUI?


maverick69(Posted 2007) [#11]
I will update the archive with the executable as soon as I am back at home. Im currently in hollidays :-)


Sledge(Posted 2007) [#12]
Top banana! Bump the thread when you do please.


Grisu(Posted 2007) [#13]
Siedge: If u need an exe so badly, gimme an email and I'll send it to you.