Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Just sharing DOS bitmap font.

This thread is locked; no one can reply to it. rss feed Print
Just sharing DOS bitmap font.
Neil Roy
Member #2,229
April 2002
avatar

I wanted a DOS 8x8 bitmap font for Allegro 5, so I managed to whip this up. It has a transparent background (in case you're wondering why it looks so white) and so should work with Allegro 5 as is if anyone is interested in it.

606245

I coloured it green to look like the old monochrome DOS terminal.

Trent Gamblin
Member #261
April 2000
avatar

If you color it white then you can use the tinting parameter to color it any color you want.

SiegeLord
Member #7,827
October 2006
avatar

Also note that since A5 uses Unicode, the bottom half of that font is not readily accessible as it uses code page 437 while Unicode will treat the bottom half as Latin-1. You'll need to use al_grab_font_from_bitmap's ranges parameter with a 1 character range essentially for every character in the bottom half (the range values can be found in the first Wikipedia link).

Although, if you're actually using the graphical characters towards the end you'll probably be using character numbers anyway, so it's not a problem... but don't expect al_draw_text("Ñá"); to work if you don't map it out properly.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Neil Roy
Member #2,229
April 2002
avatar

It's a DOS font, I find it useless without the DOS graphic characters. It's part of what I like about it. ;) I do have a white version as well. I put this together because all the font generating software doesn't make a true 8x8 bit DOS font. The best I could get was a 6 x 12 version.

606249

Anyhow, the white version. ;)

SiegeLord said:

Although, if you're actually using the graphical characters towards the end you'll probably be using character numbers anyway, so it's not a problem... but don't expect al_draw_text("Ñá"); to work if you don't map it out properly.

Thanks, I'll keep that in mind.

Luiji99
Member #12,254
September 2010

That looks pretty cool! About those characters in the top-right corner, what code points are those? I've seen them in other fonts and have no idea how to make Allegro draw them.

Also, what license are you releasing this font under?

Programming should be fun. That's why I hate Java.
http://www.entertainingsoftware.com/

Neil Roy
Member #2,229
April 2002
avatar

Public domain I guess. No license... take your pick, I won't sue you. ;D Just trying to give a little something back. ;)

Oh, and those characters range from 0 to 255, so you may have to refer to some of the characters by number. I haven't played around with it much under Allegro 5 yet, just starting making some bitmaps for A5 for my own games in the past few days.

Here's another really nice one I just created. I'll be using this in an upcoming game if anyone is interested, just give me credit if you use it. :)

I call it "FatFont", I actually edited this pixel by pixel, no preloaded fonts, so it took me a while to make, and remake (lots of errors). ;)

Looks best against a dark (ie:black) background. It is transparent and so works as is with Allegro 5.

{"name":"606264","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/9\/f\/9f5061f3618449d40408fdc664095279.png","w":257,"h":127,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/9\/f\/9f5061f3618449d40408fdc664095279"}606264

Thomas Fjellstrom
Member #476
June 2000
avatar

public domain isn't "a thing" in some countries. So there at least it'd be considered non re-distributable legally.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Neil Roy
Member #2,229
April 2002
avatar

I honestly hate all the legalities these days. Why can't I just give something away free to use? ;) I haven't got a clue which license. Whatever one allows you to use it freely in commercial or otherwise. Credit is nice, but I don't care. ;)

Thomas Fjellstrom
Member #476
June 2000
avatar

Creative Commons? That aught to work. Pick one of them :)

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Neil Roy
Member #2,229
April 2002
avatar

Steve Terry
Member #1,989
March 2002
avatar

Hey I wrote a chess game once only using the low and high ascii set in DOS mode so I actually know most of those characters :-)

___________________________________
[ Facebook ]
Microsoft is not the Borg collective. The Borg collective has got proper networking. - planetspace.de
Bill Gates is in fact Shawn Hargreaves' ßî+çh. - Gideon Weems

Neil Walker
Member #210
April 2000
avatar

Hey I wrote a chess game once only using the low and high ascii set in DOS mode so I actually know most of those characters

consider yourself lucky, when I was young I had to know all those characters and every ESC/p command/function in order to send formatted data to a printer.

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

LennyLen
Member #5,313
December 2004
avatar

consider yourself lucky, when I was young I had to know all those characters and every ESC/p command/function in order to send formatted data to a printer.

When I was young and didn't have a card with a graphics mode, I overwrote the area of memory the character set was written to so I could 'print' my own sprites to the screen. :)

Neil Walker
Member #210
April 2000
avatar

^ that's what you did/do with the ZX Spectrum :)

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Neil Roy
Member #2,229
April 2002
avatar

I have you all beat, when I was young we had to press keys which caused these metal arms to come up and hit some paper. They were called type writers and they were not electric yet. ;) We had to manually push them to get a carriage return! ;D :D

But then again, I'm older than my countries' flag. :P

LennyLen said:

When I was young and didn't have a card with a graphics mode, I overwrote the area of memory the character set was written to so I could 'print' my own sprites to the screen. :)

Sounds like a Commodore 64. I done that, used hidden memory, that was so much fun when I first discovered how to access that. :)

I also used the C64 print command to "print" sounds into memory by redirecting where the print command printed to. It was a great trick you could use for sprites etc. I still have some yellowed paper with the code stashed around here somewhere. :D

Hey I wrote a chess game once only using the low and high ascii set in DOS mode so I actually know most of those characters :-)

I'm seriously considering sitting down and DOSBOX and writing something for DOS just for old time sake. Maybe even the C64 too! LMAO

LennyLen
Member #5,313
December 2004
avatar

Neil Roy said:

Sounds like a Commodore 64. I done that, used hidden memory, that was so much fun when I first discovered how to access that

I first did this on 8bit Ataris. Then on an IBM PC-XT. With the Atari, I didn't even have any library books to use as references for memory locations, so had to discover them by sequentially changing values in meory with POKE to see the results. I had to reboot a LOT.

Steve Terry
Member #1,989
March 2002
avatar

You damn kids... why back in my day if you needed to write something you had to use sticks and stones. Could write a word a week if I kept at it most of the day! Now get off my lawn!

___________________________________
[ Facebook ]
Microsoft is not the Borg collective. The Borg collective has got proper networking. - planetspace.de
Bill Gates is in fact Shawn Hargreaves' ßî+çh. - Gideon Weems

Neil Roy
Member #2,229
April 2002
avatar

Ahoy! magazine and especially Compute! were probably the best for learning to program with their type in games. Also the Commodore 64 Programmer's Reference Guide was handy. As well as BBSes. I didn't own an IBM at the time, but I used to experiment on PC JRs and such at various places. I think part of the success story behind IBMs was things like QBasic or BasicA which made it easy for anyone to program them with "high resolution" graphics.

I definitely miss those days.

LennyLen
Member #5,313
December 2004
avatar

Neil Roy said:

Ahoy! magazine and especially Compute! were probably the best for learning to program with their type in games.

Unfortunately, they were very hard to come by in New Zealand in the 80s.

Neil Roy
Member #2,229
April 2002
avatar

They used to have those magazines, well, Compute! anyhow, at our public library. Ahoy! was my favorite of the bunch, had some of the best games you typed in. A couple were "3D", I still have them for my C64 emulator. :) I actually still have most of the magazines I bought back then, I'm a hoarder of those types of things. :)

(looks in drawer under old Heavy Metal magazines)I have the first issue of Compute! I ever bought, July 1986. :)

Dramier
Member #14,347
May 2012

I dunno about missing the old Basic days. Just thinking about all those lines of Poke and Peek to make a sprite makes me very thankful for the stuff we have now.

Although I do miss getting a new issue of whatever magazine was hot at the time and spending an hour or so plugging in lines of code just so you could debug it for another two hours to get it to run.

Load "*", 8, 1

I can't believe I still remember that.

Neil Roy
Member #2,229
April 2002
avatar

Don't forget: Load "$",8 then LIST for the device 8 directory. :)

Clear the SID (sound) chip:

POKE 209,0: POKE 210,212: POKE 211,0: ?"@@@@@@@@@@@@@@@@@@@@@@@@@";

That same trick could be used (with different pokes) to redirect the print command to the sprite area and instantly create sprites. Change some of those @'s (which is a C64 zero character) to others to instantly create sound effects. Pretty kewl stuff. :)

If you recall the IBM's BasicA "LOCATE" command which could locate the cursor on screen anywhere, the C64 had annoying graphics you had to repeat to move the cursor, but it actually had a LOCATE command, it just didn't have a basic word for it, it was available for assembly programmers. From your programs you used:

POKE 211,X: POKE 214,Y: SYS58732

I would put this into a function you would GOSUB to with X and Y set.

Machine language programming on the C64 was the most fun. The 6510 CPU was very easy to program. Fun times. Gonna have to boot up the emulator again I think. ;)

Go to: