VOGONS

Common searches


First post, by Gemini000

User metadata
Rank l33t
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

Reply 1 of 8, by VileR

User metadata
Rank l33t
Rank
l33t

This won't help you with your DeluxePaint problem... but http://www.fontstruct.com makes it incredibly easy to create pixel fonts in TrueType format. Could make modern software more usable for your purposes, and naturally your fonts will also be directly supported by Allegro, etc.

Too bad that Fontstruct sucks at (a) encoding and (b) hinting/fine-tuning, which makes it kinda useless for what I'M trying to do (create truetype fonts based on the IBM/Tandy/etc. ROM character sets), but for basic pixel fonts it's more than adequate.

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]

Reply 2 of 8, by Gemini000

User metadata
Rank l33t
Rank
l33t

I actually never need to make TTF fonts. Allegro supports bitmapped fonts, so I just do them at double the necessary resolution so they upscale nicely. Making textures that work with Allegro's font processing is very simple to do and pretty much hasn't changed in the 13 years I've been using Allegro for. ;)

Also, upscaling is easy when using software like Inkscape. You just import your bitmap, fit the bitmap pixels to Inkscape's grid, then draw in all the shapes onto that grid to match the shape of everything. :)

This effort in making custom fonts for DP2E is mostly to speed up prototyping my game stuff, as well as to make it faster to put together the game stats and such for ADG episodes, since as it stands, I have a page of font glyphs and literrally have to grab brushes of each individual character and place them pixel-accurately. x_x;

--- Kris Asick (Gemini)
--- Pixelmusement Website: www.pixelships.com
--- Ancient DOS Games Webshow: www.pixelships.com/adg

Reply 3 of 8, by Gemini000

User metadata
Rank l33t
Rank
l33t

dp2efonteditscreen01.png
Ah, QBASIC... still useful for whipping together little programs like this in under six hours. ^_^

Still have no idea how the auto-kerning works or why a huge amount of the data in the file and glyph headers seems to go ignored, but regardless, I can make my own fonts for Deluxe Paint 2E now with minimal effort... so long as my fonts aren't anything too complicated. (None of them are, since once your font starts to get elaborate enough, it's better to use modern software. :P )

I can upload this thing as source code if anyone's curious and wants to give it a run with QBASIC. I've misplaced my copy of QuickBASIC so I can't compile it at the moment, though I can just copy QuickBASIC over from my older system at some point if someone REALLY wants a binary version.

All that said, I'm probably one of maybe a tiny handful of people who still use DP2E so I'm well aware I may be the only person on this forum who cares. ;)

And yes, I use DOSBox for non-gaming stuff. I'm well aware that's not what it was designed for but I've yet to run into any problems doing this and I almost always run my backup routines immediately following just in case something goes wrong the next time. :)

--- Kris Asick (Gemini)
--- Pixelmusement Website: www.pixelships.com
--- Ancient DOS Games Webshow: www.pixelships.com/adg

Reply 4 of 8, by VileR

User metadata
Rank l33t
Rank
l33t
Gemini000 wrote:

All that said, I'm probably one of maybe a tiny handful of people who still use DP2E so I'm well aware I may be the only person on this forum who cares. 😉

I'd be the last person to urge people away from their old software as long as it still does the job, but have you checked out GrafX2? it's a modern, free and open-source spiritual successor to DP. Just ran across it yesterday and it looks potentially useful for a little CGA project I've been working on.

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]

Reply 5 of 8, by Gemini000

User metadata
Rank l33t
Rank
l33t

I've thought about trying out GrafX2, but there's something about the interface that just urks me for some reason that I've never been able to quite put my finger on. Being unable to use custom fonts with DP2E was probably the major sticking point for me and the only major reason why I was ever considering using other software.

However, with the way games are now and with my plans for future projects, DP2E more-so serves to prototype or put together the basics of something before using other software to bring it up to maximum quality. I use Inkscape for high-res design work and making finished game art, while I use an old copy of Paint Shop Pro 7 AE for artistic stuff or to do basic conversion/translucency/text work. 99% of the graphics you see on ADG that aren't game footage start life in DP2E and are then brought into PSP to add translucent effects, drop shadows, etc.

--- Kris Asick (Gemini)
--- Pixelmusement Website: www.pixelships.com
--- Ancient DOS Games Webshow: www.pixelships.com/adg

Reply 6 of 8, by ArvinMac

User metadata
Rank Newbie
Rank
Newbie

My apologies for reviving this thread. I am one of those small handful of people who use DP2E and greatly interested in using the font editor.

So, Gemini000. If you could upload the source code or provided a link to it on your webpage that would be greatly appreciated. I am using QBASIC under DOSBox , so the source code version would be fine.

Many Thanks
-ArvinMac

Reply 7 of 8, by Gemini000

User metadata
Rank l33t
Rank
l33t

Source code is attached to this reply. :B

I haven't touched this thing since I made the fonts I needed for Ancient DOS Games and the game I'm working on, so I kinda forget how it works. Fortunately, I tend to write little pieces of info to remind me of the basic functionality of my own stuff just in case so it shouldn't be TOO hard to figure out. You may want to experiment with copies of the fonts which come with DP2E before making one from scratch. If I do remember though, one of the bugs I didn't bother fixing is that if you resize a glyph that has data in it you may corrupt said data, which won't affect the rest of the file just the specific glyph you're working on. This is because DP2E mono fonts store data in blocks of 8 pixels per byte, going horizontally first then vertically, but every new line starts on a new byte, so if you have a glyph that's 10x8, it actually requires 16 bytes of font data because each line is two bytes large and simply ignores everything past the 10th bit.

Attachments

  • Filename
    DP2EFONT.zip
    File size
    3.9 KiB
    Downloads
    117 downloads
    File license
    Fair use/fair dealing exception

--- Kris Asick (Gemini)
--- Pixelmusement Website: www.pixelships.com
--- Ancient DOS Games Webshow: www.pixelships.com/adg