First post, by Gemini000
- Rank
- l33t
So I've decided once again to try and tackle the goal of figuring out how Deluxe Paint 2E's font files work in order to develop my own fonts for the program and save myself considerable amounts of time in developing my games, not to mention the game stats and such which show up on Ancient DOS Games. The first time I tried this back in 2010 I failed hard. :P
This time around however, I'm making some solid progress, at least with the monochrome fonts (which is all I really care about). The monochrome font files used in DP2E are a mix of both raw text and binary data. Each character sequence starts with a couple bytes, then in plain text "c#E" where # is the character number without leading zeroes. This is next following by a "size" sequence which again defines the number of bytes of data of the character in plain text. This is then followed by 16 bytes making up a series of 8 16-bit integers in big-endian format, the last four of which deal with character size and position, and then the remaining data are the raw pixels, one bit for each.
Beyond this, there's no extra data at the end of the file, but there is a section of 64 bytes at the start of the file which in a way, acts like a file header. The first 48 of these 64 bytes I'm still trying to figure out. The last 16 however appear to be a name in plain text without a null terminator, although most of the font files included with DP2E simply have five-digit names in these sections, as the program itself reads the filenames, not the internal names.
I COULD make a font right now given this limited information, but DP2E seems to have some kind of automatic kerning thing going on and I'm having a heck of a time trying to figure out how it even calculates when and where to perform kerning and by how much, considering the glyphs themselves don't seem to have any kerning data attached to them, yet altering single pixels in the visual appearance of glyphs alters their kerning properties.
Anyone have any ideas? Or, anyone know anyone who might be able to provide some insight into this?
And yeah I know DP2E is horribly outdated, but the thing is SO easy to prototype with... more-so than anything modern I've ever used. :)
EDIT (Several Hours Later): I'm making progress. Turns out almost ALL of that 64-byte header is completely ignored. There's only like, five bytes that do anything. XD
Of course, this also means that the kerning is apparently completely automatic, which isn't very fun for some of the fonts I want to code in but I guess it's better than not being able to do this.
So far I have a working custom font file with two glyphs. Shouldn't take too much more effort to get an entire font in there! :D
--- Kris Asick (Gemini)
--- Pixelmusement Website: www.pixelships.com
--- Ancient DOS Games Webshow: www.pixelships.com/adg