|
al_load_bitmap_font makes no sense |
Chris Katko
Member #1,881
January 2002
|
It expects at least 1px border between glyphs. I dare you to google "code page 437" and find a single upload that includes borders and the extended-ASCII set. Dwarf Fortress ASCII tilesets? Nope. VGA font? Nope. code page 437? Nope. I can't find a single font that works with this function. Why isn't there a switch (or function) to use either: - Specify arguments for size and padding values. - Figure out the font dimensions automatically by assuming fixed-width, and (optionally?) a set number of characters (or just default to 256). My only guess here (and it's likely) is that this function was intended for use with variable-length fonts? (Hence the px border) But you would almost always use TTF for variable length fonts. So it seems like we implemented the rarest possible case... and left out the most common one. -----sig: |
SiegeLord
Member #7,827
October 2006
|
We could certainly add a function to handle these formats... like al_load_fixed_bitmap_font or al_load_grid_bitmap_font. As it is, I think the easiest thing would actually be to create a bmfont XML file to tell Allegro how to read such things: <font> <info face="font" size="8" bold="0" italic="0" charset="" unicode="" /> <common lineHeight="8" base="0" pages="1" /> <pages> <page id="0" file="the_font.png"/> </pages> <chars count="100"> <char id="32" x="0" y="0" width="8" height="8 xoffset="0" yoffset="0" xadvance="8" page="0" chnl="15"/> ...and so on... </font> Save that with .fnt extension and load that with al_load_font. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Edgar Reynaldo
Major Reynaldo
May 2007
|
It's a relic of the Allegro 4 bitmap fonts, which had the same restrictions. What you need is one of those pink yellow and black or white fonts, like this : https://www.allegro.cc/files/attachment/611937 You can download my Allegro 4 Font Maker here : My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|