- Build 34397
- Platform Steam
The charset for CJK characters in the game is incomplete, and thus lots of characters will be replaced by a question mark (?) automatically.
It seems the charset is currently loaded using an atlas named “combined_####.dds” in the “resources\common\fonts” folder, and only about 2K chars are included in these atlases, while currently at least about 6K chars should be included in order to cover most used chars in east Asian languages.
I’m also tried to generate the atlas and replace the default one but the there is lack of knowledge about the “combined.box” metadata file. Could you also please give some useful information about how to generate the metadata and DirectDraw Surface file? that should be very useful for users want to replace the default game font for customization.
- Open the game and go to the multiplayer lobby
- Try to type the CJK character ‘秦’ (U+79E6) and send the message
- You will see a question mark in the char panel
To my knowledge, the combined*.box format is much the mirroring of the data you can see in combined*.txt. That is, if you read binary:
Format Version: 4 bytes, integer, big-endian - in my version of file 0x2 (2)
Glyph Count: 4 bytes, integer, big-endian - 0x1A0B (6667)
Texture Page Count: 4 bytes, integer, big-endian - 0x2 (2)
Source Font Pixel Size: 4 bytes, float, big-endian - 0x42800000 (64)
Exactly <Glyph Count> times of data collections, each has 10 numbers:
W (glyph width in pixel, always integer?): 4 bytes, float, big-endian
H (glyph height in pixel, always integer?): 4 bytes, float, big-endian
U (glyph start X position from the left of texture in ratio): 4 bytes, float, big-endian
S (glyph end X position from the left of texture in ratio): 4 bytes, float, big-endian
V (glyph start Y position from the top of texture in ratio): 4 bytes, float, big-endian
T (glyph end Y position from the top of texture in ratio): 4 bytes, float, big-endian
Atlas (the texture page number the glyph exists on): 4 bytes, integer, big-endian
X0 (the amount pushing the glyph to the right to align; in pixel(?)): 4 bytes, float, big-endian
Y0 (the amount pushing the glyph down to align; in pixel(?)): 4 bytes, float, big-endian
HAdvance (the real width of the glyph i.e. room until the next glyph in pixel): 4 bytes, float, big-endian
Exactly <Glyph Count> times of data pairs (currently sorted by the second number in ascending order):
Code Point (of Unicode): 2 bytes, integer (unsigned), big-endian
Entry Number (which data in the Coordinates Section represents this; starting from 0): 2 bytes, integer, big-endian
Although I don’t know what kind of program they use to generate DDS, I guess what they do is something similar to what 0AD’s font builder does, so you may want to try it: https://github.com/0ad/0ad/tree/master/source/tools/fontbuilder2.
The textures they generated look very colorful, but according to my quick experiment, color channels currently do nothing in the game, so you might as well simply generate white-glyphs-on-transparent PNGs, then convert them to DDS.
Many thanks! I’ll try it now!
Sorry, for my unknown brain circuit bug I wrote every endianness the other way around. They’re all little-endian which is obvious if you open the actual files.
Hi, many thanks again for your help. My custom font generator is done! you may visit the project home page if you are intereseted, it is free to use
Hi dude, now I’m meeting another problem. For 720p resolution, the game does not use combined.dds, but uses basic_bold_16.dds and basic_bold_16.fnt, while the fnt format looks different with the box file. Do you have any knowledge about the FNT file? Many thanks!
@IdleMagician268 Hi buddy do you have any idea for the FNT format? Many thanks~
@DodoNotDoDo hi dude can you help with the data format of FNT font files? Many thanks!