Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » al_load_bitmap

This thread is locked; no one can reply to it. rss feed Print
al_load_bitmap
CodeStepper
Member #14,495
August 2012
avatar

Hello everyone.

How to create bitmap with font for allegro?
I tried FontEditor (from here), but it displays black box instead of characters. FontBuilder export image with description (xml)... I tried even Bitmap Font Generator (.fnt... ARGH...), and Irrlicht Font Maker (draw dots in bitmap)...
I know that I can load TTF/OTF..., but I'm interested in bitmap fonts.

Thanks in advance.

beoran
Member #12,636
March 2011

You need to link and initialize the font addon, then use al_grab_font_from_bitmap()
to load a bitmap to a font. Look at the documentation of this function to learn about the required format.

CodeStepper
Member #14,495
August 2012
avatar

Hmm... I know...
I mean... not how to LOAD. I mean how to CREATE/PREPARE bitmap. For example with selected ttf/otf font.

beoran
Member #12,636
March 2011

You could make the font bitmap with any image editor or image tool you like, as long as the format is correct. Basically, the background (transparent) color is at the top left hand corner ((0,0) coordinates) of the bitmap, and every glyph needs a rectangular border of that color around it. Look at this thread for a few example bitmap fonts that can be used together with Allegro:

https://www.allegro.cc/forums/thread/610576

CodeStepper
Member #14,495
August 2012
avatar

Thanks, that's what I mean!
:)

Go to: