Reverse engineered version of the Strife BIGFONT file

Sprites, textures, sounds, code, and other resources belong here. Share and share-alike!
Forum rules
Before posting your Resource, please make sure you can answer YES to any of the following questions:
  • Is the resource ENTIRELY my own work?
  • If no to the previous one, do I have permission from the original author?
  • If no to the previous one, did I put a reasonable amount of work into the resource myself, such that the changes are noticeably different from the source that I could take credit for them?
If you answered no to all three, maybe you should consider taking your stuff somewhere other than the Resources forum.

Consult the Resource/Request Posting Guidelines for more information.

Please don't put requests here! They have their own forum --> here. Thank you!

Reverse engineered version of the Strife BIGFONT file

Postby Undead » Mon Jan 07, 2019 4:49 pm

Well, I spent the entire day busting my rear end on this, and it’s not 100% reliable, but I’ll share it here. And I also want to share some findings that I’ve made. It’s gonna be a long read, but I can’t leave out any details, because these resources are not fully reliable on their own without some of the info in this post.

I’ve been working with ImageTool for quite some time; pretty handy program that allows you to replace GZDoom’s BIGFONT files. It comes with a source file for GZDoom’s BIGFONT file for the Doom games (located in zd_extra.pk3 and named dbigfont.lmp). Strife uses the same system and has its own BIGFONT file located in the same .pk3 file under the name of sbigfont.lmp; however, it has no source file that comes with ImageTool like Doom. Which means tough luck for anyone who wants to edit the Strife font, since neither ImageTool nor Spidey’s ZDoom Font Generator can extract and convert GZDoom’s own BIGFONT files into editable formats for some reason.

Well, I’ve done my best to reverse engineer the Strife BIGFONT file by extracting it as a .png file in SLADE and putting all the characters in a .pcx file with GIMP, assembling everything to make it ready to be converted in ImageTool. So now the Strife BIGFONT can be edited by other people. Hooray! However, while 99% accurate to the current sbigfont.lmp file in zd-extra.pk3, it doesn’t behave exactly like it when converted. After converting the file and loading it in GZDoom, it somehow causes all characters to have have extra spacing between them (this applies to Doom too, even the original Doom BIGFONT source file that comes with ImageTool for some reason):

Original GZDoom
Reverse engineered BIGFONT

So, I wondered what I could do to eliminate this and make it more similar to the GZDoom file. Well, having looked closer at the original sbigfont.lmp file in GZDoom, I noticed that there is no initial space character in the very beginning of the file (7px wide). Which is weird. (This is visible in SLADE—there is no extra space on the very left side of the sbigfont.lmp file when you compare it to dbigfont.lmp, which has a 7px wide space character.) So I turned the space character in my reverse engineered file (appears at the very top left) into a blank no-width character instead and converted it to an .lmp file to try it out.

This leads to something interesting: obviously, you end up with no spaces between words. However, what you can do is use a hex editor or a file comparer of some sort to even out the differences between the reverse engineered .lmp and the GZDoom version. (Personally, I’ve used WinMerge to merge the only difference that appears at the very top of the file after turning it into an .lmp graphic. Just make sure both files are opened with the same codepage. Fast and simple.) And this causes spaces between words to work flawlessly while eliminating extra spaces between the characters as shown in the latter image above! It becomes 100% identical to the file that’s already that used to be in GZDoom.



So, after reverse engineering the file, I noticed that there are a couple of issues with GZDoom’s Strife BIGFONT file:
  • The letter W was created from scratch instead of being taken from the game’s own graphical assets, which is strange. Maybe someone missed it when making the bigfont file in the first place.
  • The number 9 and letter Y are affected by some strange pixel artifacting at the very bottom that goes outside of Strife’s color palette. Not noticeable ingame, but strange nonetheless.
    • When reverse engineering, I had to edit the palette of the .pcx file to accomodate these artifacts. If you want to edit a .pcx file that is accurate to Strife’s palette, the fixed version below provides that.
So I edited the file and made my own take on it, fixing the aforementioned problems and slightly altering the lighting on the digits. I also had to take a different approach to hex editing the file. In WinMerge, I changed this line:

Image

to this:

Image

Changing that “00” to “01 яя” removes the extra spacing in the file.

Here’s a comparison between the GZDoom file and my fixed version (.pcx versions of both files for ImageTool are provided in the .zip file below):

Image

Image

(I’d ask the individual who programmed ImageTool for help with all of this, but you know.)

Bottom line: I did my best to reverse engineer this file, and the results were quite hard to get, but I managed. And it is now in GZDoom!
Attachments
sbigfont_reverse_engineered.zip
(8.05 KiB) Downloaded 13 times
Last edited by Undead on Fri Feb 01, 2019 5:33 pm, edited 8 times in total.
User avatar
Undead
 
 
 
Joined: 26 Dec 2013
Location: Sweden

Re: Reverse engineered version of the Strife BIGFONT file

Postby Undead » Thu Jan 24, 2019 5:35 am

I’ve updated the post with better information and a positive conclusion (having finally figured out how to deal with the two, other problems I had earlier).
User avatar
Undead
 
 
 
Joined: 26 Dec 2013
Location: Sweden


Return to Resources

Who is online

Users browsing this forum: No registered users and 3 guests