Asaf
Sleep Deprived
- Joined
- Mar 22, 2010
- Messages
- 1,326
Yes, you've read it right. An editor for the gamefont files.
Apparently they're evil

This editor is meant to free modders from the need to edit and maintain the grid that surrounds the actual icons, manage the 'used icon' markers, and generally prevent any possible corruption of the font files.
I also intend for it to automatically fix most of the already corrupted font files.
I've started working on this editor, but it is not yet usable. Since my experience with these files consists of adding 1 icon to each of the files, and I'm not completely sure how this editor should behave, I thought of getting feed back as early as possible.
What I have so far:

I have a program which loads the selected game font file, and analyzes it to the level of knowing where each slot is on the image, and whether it is used or not (has the cyan marker).
It ignores problems in the grid's alpha channel and will be able to fix them.
As you can see, the current behavior is such that when hovering over an icon it is displayed on the side, along with some information on it (whether it is used or not, size and position).
In case you were wondering, it works on both gamefont and gamefont_75 (and analyzes them correctly - including the funky line where there's one icon which is smaller than the others), as well as on the BUG gamefont file.
What I plan to do:
Must-have features
- First and most importantly, to allow editing of specific slots. That means to enable exporting specific icons to image files, and allow importing of image files into specific slots in the fonts image.
- Allow enabling and disabling of certain slots with a click of a button (will be done by adding/removing the cyan marker).
Important features
- Automatic fix of the grid's alpha channel.
- Identifying the slots even if some of the grid is corrupted.
Optional features
- Allow opening of an image editor for a specific slot (in a similar manner to DXTBmp, only for a specific slot) instead of saving to a file and loading to a file. Maybe split to alpha/non alpha.
- Adding automatic meta data: for example - read the religion/corporation XML files and display for each icon which religion/corporation it is used for.
- Automatically create an alpha channel for an icon from the image (using a "background color").
There are more features that crossed my mind, but this is what I can remember now.
What I need from you:
Quite a few things, actually.
Since many of you worked with the font files much longer than I have, I'd appreciate any advice I can get on this.
Specifically, these are the things I though of:
Questions
These are questions I have with regards to how the gamefonts work. I intend to start experimenting with these, but I thought that maybe someone already has some of the answers.
1. Do the markers have to be in a specific position? It is mostly consistent within the same file (GameFont.tga - 17 pixels below the seperator line, GameFont_75.tga - 14 pixels), but within the 75, two of the commerce types have their markers moved by a pixel.
2. Can slots be skipped? For example - can the first 3 slots in a specific row be used, the 4th unused, and then the 5th used again? I'm talking about the markers, and not the code that assigns symbol id's (either DLL or Python in BUG's case).
3. Can you add additional rows to the font file beyond those already surrounded with grid? Same questions for more slots in a specific row.
4. Is the iPadAmount (I think that's what it's called) in CvGameTextMgr::assignFontIds constant, or is it actually calculated according to the font file?
5. When is each of the font files used?
6. I'm assuming (because of BUG) that the two font files don't have to be exactly the same slots-wise?
Other requests
Please feel free to throw in ideas for other features for this editor, or changes that you think are needed for my ideas.
If you have specific issues that you've come across when working with these files (and that are not already explained in one of the tutorials), I also want to know.
I'd also appreciate if you can attach your corrupted game font files so I can take a look at them and see if I can add automatic fixes for them.
This is just a development thread. Once I have a utility that can actually be used I'll post it in a new thread, and the discussion will go there.
Thank you for your help.
Apparently they're evil


This editor is meant to free modders from the need to edit and maintain the grid that surrounds the actual icons, manage the 'used icon' markers, and generally prevent any possible corruption of the font files.
I also intend for it to automatically fix most of the already corrupted font files.
I've started working on this editor, but it is not yet usable. Since my experience with these files consists of adding 1 icon to each of the files, and I'm not completely sure how this editor should behave, I thought of getting feed back as early as possible.
What I have so far:

I have a program which loads the selected game font file, and analyzes it to the level of knowing where each slot is on the image, and whether it is used or not (has the cyan marker).
It ignores problems in the grid's alpha channel and will be able to fix them.
As you can see, the current behavior is such that when hovering over an icon it is displayed on the side, along with some information on it (whether it is used or not, size and position).
In case you were wondering, it works on both gamefont and gamefont_75 (and analyzes them correctly - including the funky line where there's one icon which is smaller than the others), as well as on the BUG gamefont file.
What I plan to do:
Must-have features
- First and most importantly, to allow editing of specific slots. That means to enable exporting specific icons to image files, and allow importing of image files into specific slots in the fonts image.
- Allow enabling and disabling of certain slots with a click of a button (will be done by adding/removing the cyan marker).
Important features
- Automatic fix of the grid's alpha channel.
- Identifying the slots even if some of the grid is corrupted.
Optional features
- Allow opening of an image editor for a specific slot (in a similar manner to DXTBmp, only for a specific slot) instead of saving to a file and loading to a file. Maybe split to alpha/non alpha.
- Adding automatic meta data: for example - read the religion/corporation XML files and display for each icon which religion/corporation it is used for.
- Automatically create an alpha channel for an icon from the image (using a "background color").
There are more features that crossed my mind, but this is what I can remember now.
What I need from you:
Quite a few things, actually.
Since many of you worked with the font files much longer than I have, I'd appreciate any advice I can get on this.
Specifically, these are the things I though of:
Questions
These are questions I have with regards to how the gamefonts work. I intend to start experimenting with these, but I thought that maybe someone already has some of the answers.
1. Do the markers have to be in a specific position? It is mostly consistent within the same file (GameFont.tga - 17 pixels below the seperator line, GameFont_75.tga - 14 pixels), but within the 75, two of the commerce types have their markers moved by a pixel.
2. Can slots be skipped? For example - can the first 3 slots in a specific row be used, the 4th unused, and then the 5th used again? I'm talking about the markers, and not the code that assigns symbol id's (either DLL or Python in BUG's case).
3. Can you add additional rows to the font file beyond those already surrounded with grid? Same questions for more slots in a specific row.
4. Is the iPadAmount (I think that's what it's called) in CvGameTextMgr::assignFontIds constant, or is it actually calculated according to the font file?
5. When is each of the font files used?
6. I'm assuming (because of BUG) that the two font files don't have to be exactly the same slots-wise?
Other requests
Please feel free to throw in ideas for other features for this editor, or changes that you think are needed for my ideas.
If you have specific issues that you've come across when working with these files (and that are not already explained in one of the tutorials), I also want to know.
I'd also appreciate if you can attach your corrupted game font files so I can take a look at them and see if I can add automatic fixes for them.
This is just a development thread. Once I have a utility that can actually be used I'll post it in a new thread, and the discussion will go there.
Thank you for your help.