Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » allegro4 unicode bitmap font spritesheet

This thread is locked; no one can reply to it. rss feed Print
allegro4 unicode bitmap font spritesheet
m c
Member #5,337
December 2004
avatar

I had a vague idea that back in a4 if you wanted a font with various code ranges, you would have to load a .dat font or something? Or use a ttf addon.

Well I wanted to have a terminal emulator with the ms dos box drawing chars so I tried to find out but it was all confusing to me. so I might hacked together something that loads sprite sheet font that recognizes the utf8 codes of the ibm437 charset from pic attached. if you more knowledgeable guys than me have useful things about this, such as tips or more unicode ranges in bitmap font sheets, I'd love it.

610907

(\ /)
(O.o)
(> <)

Audric
Member #907
January 2001

You may want to "forget" that you're drawing text, and consider it as a straight graphic resource. If you load / split the font image into bitmaps, it's trivial to code your text-printing function that takes a string as input.

Just be aware that char is often signed by default.
If you store the font as an array of 256 bitmaps, be sure to cast the characters when you index it: myfont[(unsigned char)(str[i])]

m c
Member #5,337
December 2004
avatar

oh right, otherwise its a negative array offset

(\ /)
(O.o)
(> <)

Go to: