This is a quick readme for my fontlib released in a hurry.
This lib will allow you to draw strings with any font on screen,
with many characters not available usually.
For this you'll have to download bitmap font builder :
(windows only I think...)
Then you make a font texture in bmp format, and save font
widths in ini format. You have to use the full ascii character set
with pure white bg and pure black letters. Texture size cannot exceed
Once you have your bmp and ini files, you'll have to use the bmpfconvert
tool I provide, run in dos mode. Copy the bmp near the exe.
cd to the dir where you have the exe and the freeimage dll and type:
bmpfconvert <name of image without ".bmp">
This will get rid of the white bg and leave the black parts, grey parts
are converted to the associated transparent black.
I also added parameters for you if you want the color to be changed, so
to make it yellow 50% transparent type that:
bmpfconvert <name of image without ".bmp"> 255 255 0 127
The exe will create a png for you. You are then free to modify that in
photoshop for example.
Now you can use that png file and ini file together to have a bmpfont in
lua. They have to be named exactly the same, with their respective
extensions (png and ini).
Put the bmpFontLib folder in your application.
Then, add those lines in your script:
you can omit the first if you put the folder directly near your
index.lua file, otherwise give it the path to the containing folder,
it has to end with "/".
Now you can use bmpfonts and bmptexts. Look in my example file
(index.lua). Note that you'll have to work with files encoded in
utf-8. So, open index.lua in utf-8 or you'll see strange chars.
I edit my files in Eclipse, I know JEdit can do that, and I
think Ultra Edit does too. But many advanced editors should be
able to do that (forget notepad and wordpad unless your system
is set up for using utf-8).
There are many functions available for you, not well documented
(or not at all), sorry for that, just try.
Also, you may notice that the file does not run fast, and that's the
fontPrint doing that. Comment it you'll see how it improves :).
If the font looks crappy and you lost transparency, that's a luaplayer
bug. So either accept it and don't use font smoothing, or draw directly
on screen without compiling the texts. But that second solution
is much slower as there will be as many blits as characters in your