Author Topic: War2 fonts (.fnt)  (Read 24549 times)

Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1653
    • View Profile
War2 fonts (.fnt)
« on: January 23, 2019, 03:00:53 PM »
Anybody knows any software to work with war2 .fnt-files?

I know the .fnt-file format, but how to work with it if i'm a user, not a programmer? What if i want to add a new language into war2?
I can't trust there's no software for that purposes, but i googled any .fnt-related software for war2/starcraft and find nothing except the description of font/letter headers.

Looks like i have to write my own program, but i'm lazy for that.
Any ideas?
Need help to translate War2Combat to German, French, Italian, Polish or another language: http://forum.war2.ru/index.php/topic,4728.0.html
Please, contact me if you are interested in that.

Offline Szwagier

  • Ogre Mage
  • ********
  • Posts: 1707
    • View Profile
Re: War2 fonts (.fnt)
« Reply #1 on: January 24, 2019, 03:03:36 AM »
Hex editor work with it, you need Just translate everything
http://www.youtube.com/user/SzwagierR


Equinox - the dumbest person in this game, do not argue with an idiot, because he will bring you to his level and overcome with experience

Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1653
    • View Profile
Re: War2 fonts (.fnt)
« Reply #2 on: January 24, 2019, 03:42:12 AM »
im still not sure if this is the fnt war2 is using
Yes, as i understand that uses a well-known old dos .fnt-format that is not compatible with war2 (just the same file extension as it's also a font).

At least, war2 fonts looks completely different than any other .fnt-files.

So, still looking for any war2-font-working software, let me know if you know something...
Need help to translate War2Combat to German, French, Italian, Polish or another language: http://forum.war2.ru/index.php/topic,4728.0.html
Please, contact me if you are interested in that.

Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1653
    • View Profile
Re: War2 fonts (.fnt)
« Reply #3 on: January 24, 2019, 06:44:00 PM »
Well, i'll just publish my source code here, i used it to fix russian fonts about 10 years ago.
That program can be started as:
prog.exe font.fnt
it shows all the letters raster in text mode (each point is a number).
Program is most likely useless, except the source code to read and parse the whole .fnt-file
You can make something useful based on it.
Here's it:
Code: [Select]
// fontwar2.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include<stdio.h>
#include<windows.h>

#define MAX_LEETER_NUM 256
void bmp2fnt();
void cp2win(char *,int,int);
int getletter(char *,unsigned,char *);

typedef struct _FontHeader {
DWORD Name; // Always is "FONT"
BYTE LowIndex; // Index of first letter in file
BYTE HighIndex; // Index of the last letter in file
BYTE MaxWidth; // Maximum width
BYTE MaxHeight; // Maximum height
DWORD Unk1; // Unknown / Unused
} FontHeader;

typedef struct  _FontLetterRaw {
BYTE Width; // Width of the letter
BYTE Height; // Height of the letter
BYTE XOffset; // X Offset for the topleft corner of the letter.
BYTE YOffset; // Y Offset for the topleft corner of the letter.
} FontLetterRaw;

//DWORD letterofs[MAX_LEETER_NUM];
//FontHeader fontheader;
//FontLetterRaw letterheader;


int main(int argc, char* argv[])
{
/* FILE *in;
int i,pixelcounter,toskip;
BYTE c;
if(argc<2){printf("Usage: fontwar2 <filename.fnt> [-w]\n");return 0;}
in=fopen(argv[1],"rb");
if(!in){printf("Data error reading file %s\n",argv[1]);return 1;}
if(!fread(&fontheader,sizeof(FontHeader),1,in)){printf("Error in %s\n",argv[1]);return 2;}
printf("ok: %d, %d, %d, %d",fontheader.LowIndex,fontheader.HighIndex,fontheader.MaxWidth,fontheader.MaxHeight);
for(i=fontheader.LowIndex;i<fontheader.HighIndex;i++)
{
if(i>=MAX_LEETER_NUM){printf("Error! too many letters\n");return 3;}
fread(&letterofs[i],4,1,in);
// printf("%d ",letterofs[i]);
}

printf("\n");

for(i=fontheader.LowIndex;i<fontheader.HighIndex;i++)
{
if(letterofs[i]==0){printf("skip\n");continue;}
fseek(in,letterofs[i],SEEK_SET);
fread(&letterheader,sizeof(FontLetterRaw),1,in);
printf("%d %d^\n",letterheader.Width,letterheader.Height);
toskip=0;
printf("Begin %d\n",i+1);
for(pixelcounter=0;pixelcounter<letterheader.Width*letterheader.Height;pixelcounter++)
{
if(toskip-->0)
{
printf("-");
}
else{
if(pixelcounter)printf("%d",c&7);
c=fgetc(in);
toskip=c>>3;
}
if(pixelcounter%letterheader.Width==0)printf("\n");
}
printf("%d\n",c&7);
printf("End\n");
}
printf("!%d!\n",ftell(in));
fclose(in);

// bmp2fnt();
if(argc>2&&strcmp(argv[2],"-w")==0)cp2win(argv[1],fontheader.LowIndex,fontheader.HighIndex);*/
char buf[1024]; // FIXME! insecure
// if(argc<4){printf("Usage: fontwar2 <source1.fnt> <source2.fnt> <target.fnt>\n");return 0;}

int outfnt[32768]; // FIXME! insecure
int outfnt_seek=0,letsize;
char header[]={'F','O','N','T',0x20,0xff,0x0e,0x0e};
FontHeader outfh;
outfh.LowIndex=header[4];
outfh.HighIndex=header[5];
outfh.MaxWidth=header[6];
outfh.MaxHeight=header[7];

memset(outfnt,0,sizeof(outfnt));
memcpy(outfnt,header,sizeof(header));
outfnt_seek=(outfh.HighIndex+1-outfh.LowIndex)*4+sizeof(header);

if(argc==2)
{
for(int i=outfh.LowIndex;i<=outfh.HighIndex;i++)
getletter(argv[1],i,(char *)outfnt+outfnt_seek);
return 0;
}

for(int i=outfh.LowIndex;i<=outfh.HighIndex;i++)
{
switch(i)
{
case 128:letsize=getletter(argv[2],'З',(char *)outfnt+outfnt_seek);break;
case 129:letsize=getletter(argv[2],'ь',(char *)outfnt+outfnt_seek);break;
case 130:letsize=getletter(argv[2],'й',(char *)outfnt+outfnt_seek);break;
case 131:letsize=getletter(argv[2],'в',(char *)outfnt+outfnt_seek);break;
case 132:letsize=getletter(argv[2],'д',(char *)outfnt+outfnt_seek);break;
case 133:letsize=getletter(argv[2],'а',(char *)outfnt+outfnt_seek);break;
case 134:letsize=getletter(argv[2],'е',(char *)outfnt+outfnt_seek);break;
case 135:letsize=getletter(argv[2],'з',(char *)outfnt+outfnt_seek);break;
case 136:letsize=getletter(argv[2],'к',(char *)outfnt+outfnt_seek);break;
case 137:letsize=getletter(argv[2],'л',(char *)outfnt+outfnt_seek);break;
case 138:letsize=getletter(argv[2],'и',(char *)outfnt+outfnt_seek);break;
case 139:letsize=getletter(argv[2],'п',(char *)outfnt+outfnt_seek);break;
case 140:letsize=getletter(argv[2],'о',(char *)outfnt+outfnt_seek);break;
case 141:letsize=getletter(argv[2],'м',(char *)outfnt+outfnt_seek);break;
case 142:letsize=getletter(argv[2],'Д',(char *)outfnt+outfnt_seek);break;
case 143:letsize=getletter(argv[2],'Е',(char *)outfnt+outfnt_seek);break;
case 144:letsize=getletter(argv[2],'Й',(char *)outfnt+outfnt_seek);break;
case 145:letsize=getletter(argv[2],'ж',(char *)outfnt+outfnt_seek);break;
case 146:letsize=getletter(argv[2],'Ж',(char *)outfnt+outfnt_seek);break;
case 147:letsize=getletter(argv[2],'ф',(char *)outfnt+outfnt_seek);break;
case 148:letsize=getletter(argv[2],'ц',(char *)outfnt+outfnt_seek);break;
case 149:letsize=getletter(argv[2],'т',(char *)outfnt+outfnt_seek);break;
case 150:letsize=getletter(argv[2],'ы',(char *)outfnt+outfnt_seek);break;
case 151:letsize=getletter(argv[2],'щ',(char *)outfnt+outfnt_seek);break;
case 152:letsize=getletter(argv[2],'я',(char *)outfnt+outfnt_seek);break;
case 153:letsize=getletter(argv[2],'Ц',(char *)outfnt+outfnt_seek);break;
case 154:letsize=getletter(argv[2],'Ь',(char *)outfnt+outfnt_seek);break;
case 155:letsize=getletter(argv[2],'ш',(char *)outfnt+outfnt_seek);break;
// case 156:letsize=getletter(argv[2],'Ь',(char *)outfnt+outfnt_seek);break;
case 157:letsize=getletter(argv[2],'Ш',(char *)outfnt+outfnt_seek);break;
case 158:letsize=getletter(argv[2],'Ч',(char *)outfnt+outfnt_seek);break;
// case 159:letsize=getletter(argv[2],'Я',(char *)outfnt+outfnt_seek);break;
case 160:letsize=getletter(argv[2],'б',(char *)outfnt+outfnt_seek);break;
case 161:letsize=getletter(argv[2],'н',(char *)outfnt+outfnt_seek);break;
case 162:letsize=getletter(argv[2],'у',(char *)outfnt+outfnt_seek);break;
case 163:letsize=getletter(argv[2],'ъ',(char *)outfnt+outfnt_seek);break;
case 164:letsize=getletter(argv[2],'с',(char *)outfnt+outfnt_seek);break;
case 165:letsize=getletter(argv[2],'С',(char *)outfnt+outfnt_seek);break;

case 181:letsize=getletter(argv[2],'Б',(char *)outfnt+outfnt_seek);break;
case 182:letsize=getletter(argv[2],'В',(char *)outfnt+outfnt_seek);break;
case 183:letsize=getletter(argv[2],'А',(char *)outfnt+outfnt_seek);break;
case 198:letsize=getletter(argv[2],'г',(char *)outfnt+outfnt_seek);break;
case 199:letsize=getletter(argv[2],'Г',(char *)outfnt+outfnt_seek);break;
case 208:letsize=getletter(argv[2],'р',(char *)outfnt+outfnt_seek);break;
case 209:letsize=getletter(argv[2],'Р',(char *)outfnt+outfnt_seek);break;
case 210:letsize=getletter(argv[2],'К',(char *)outfnt+outfnt_seek);break;
case 211:letsize=getletter(argv[2],'Л',(char *)outfnt+outfnt_seek);break;
case 212:letsize=getletter(argv[2],'И',(char *)outfnt+outfnt_seek);break;
case 214:letsize=getletter(argv[2],'Н',(char *)outfnt+outfnt_seek);break;
case 215:letsize=getletter(argv[2],'О',(char *)outfnt+outfnt_seek);break;
case 216:letsize=getletter(argv[2],'П',(char *)outfnt+outfnt_seek);break;
case 222:letsize=getletter(argv[2],'М',(char *)outfnt+outfnt_seek);break;
case 224:letsize=getletter(argv[2],'У',(char *)outfnt+outfnt_seek);break;
case 225:letsize=getletter(argv[2],'Я',(char *)outfnt+outfnt_seek);break;
case 226:letsize=getletter(argv[2],'Ф',(char *)outfnt+outfnt_seek);break;
case 227:letsize=getletter(argv[2],'Т',(char *)outfnt+outfnt_seek);break;
case 228:letsize=getletter(argv[2],'х',(char *)outfnt+outfnt_seek);break;
case 229:letsize=getletter(argv[2],'Х',(char *)outfnt+outfnt_seek);break;
case 231:letsize=getletter(argv[2],'ю',(char *)outfnt+outfnt_seek);break;
case 232:letsize=getletter(argv[2],'Ю',(char *)outfnt+outfnt_seek);break;
case 233:letsize=getletter(argv[2],'Ъ',(char *)outfnt+outfnt_seek);break;
case 234:letsize=getletter(argv[2],'Ы',(char *)outfnt+outfnt_seek);break;
case 235:letsize=getletter(argv[2],'Щ',(char *)outfnt+outfnt_seek);break;
case 236:letsize=getletter(argv[2],'э',(char *)outfnt+outfnt_seek);break;
case 237:letsize=getletter(argv[2],'Э',(char *)outfnt+outfnt_seek);break;
case 246:letsize=getletter(argv[2],'ч',(char *)outfnt+outfnt_seek);break;
default:
if(i<128)letsize=getletter(argv[2],i,(char *)outfnt+outfnt_seek);
else letsize=getletter(argv[1],i,(char *)outfnt+outfnt_seek);
}

printf("len: %d\twriting %x\t",letsize,letsize?outfnt_seek:0);
outfnt[i-outfh.LowIndex+sizeof(header)/4]=letsize?outfnt_seek:0;
outfnt_seek+=letsize;
}
// int i=getletter(argv[1],247,buf);
// printf("len: %d\n",i);
FILE *out=fopen(argv[3],"wb");
if(!out){printf("!out");return 1;}
if(!fwrite(outfnt,outfnt_seek,1,out))printf("Error writing %s\n",argv[3]);

printf("!%x!",getletter(argv[1],33,(char *)outfnt));
return 0;
}
int getletter(char *filename,unsigned letnum,char *buf)
{
FILE *in;
FontHeader fh;
FontLetterRaw flr;
int pixelcounter;
int ofs=0,toskip=0,in_ofs;
char c;
in=fopen(filename,"rb");
letnum=(letnum+256)%256;
printf ("let:%d:num\t",letnum);
if(!in){printf("Data error reading file %s\n",filename);return 1;}
if(!fread(&fh,sizeof(FontHeader),1,in)){printf("Error in %s\n",filename);return 2;}
if(letnum<=fh.LowIndex||letnum>fh.HighIndex)return 0;
fseek(in,8+(letnum-fh.LowIndex)*4,SEEK_SET);
if(!fread(&in_ofs,4,1,in)){printf("Error in %s\n",filename);return 2;}
//printf("letofs: %X\n",in_ofs);
if(in_ofs==0)return 0;
fseek(in,in_ofs,SEEK_SET);
if(!fread(&flr,sizeof(FontLetterRaw),1,in)){printf("Error in %s\n",filename);return 2;}
memcpy(buf+ofs,&flr,sizeof(flr));
ofs+=sizeof(flr);
for(pixelcounter=0;pixelcounter<flr.Width*flr.Height;pixelcounter++)
{
if(toskip-->0)
{
printf("-");
}
else{
if(pixelcounter)printf("%d",c&7);
c=fgetc(in);
toskip=c>>3;
buf[ofs++]=c;
}
if(pixelcounter%flr.Width==0)printf("\n");
}
printf("%d\n",c&7);
return ofs;
}
/*void cp2win(char *fntfilename,int low,int high)
{
DWORD cp[256];
DWORD win[256];
FILE *fnt;
fnt=fopen(fntfilename,"r+b");
if(!fnt){printf("!fnt\n");return;}
fseek(fnt,12,SEEK_SET);
memset(cp,0,sizeof(cp));
memset(win,0,sizeof(win));
if(fread(cp+low,4,high-low,fnt)!=(unsigned)(high-low)){printf("!fread\n");return;}
//for(int i=low;i<high;i++)printf("%4X ",cp[i]);
for(int i=low;i<high;i++)
{
//      if(i>=0x80-1&&i<0xb0-1)win[i]=cp[i+0x40];
// else if(i>=0xc0-1&&i<0xf0-1)win[i]=cp[i-0x40];
// else if(i>=0xb0-1&&i<0xc0-1)win[i]=cp[i+0x40];
// else if(i>=0xf0-1&&i<0x100-1)win[i]=cp[i-0x10];
// if(i==128)win[i]=cp[129];
// else
// win[i]=cp[i];
// switch(i)
// {
// case "└":win[]=cp[i];
// }
}
fseek(fnt,12,SEEK_SET);
if(fwrite(win+low,4,high-low,fnt)!=(unsigned)(high-low)){printf("!fwrite\n");return;}
printf("font file written successfully\n");
fclose(fnt);
}
/*void bmp2fnt()
{
BYTE fnt[65536];
BYTE buf[16][16];
int fnt_len=0;
int width=14,bmp_width=16,height=14,letternum=239-32;

int i,j,k,len,seek,c,toskip=0;
FILE *in=fopen("game.bmp","rb");
if(!in){printf("!in");return;}
FILE *out=fopen("out.fnt","wb");
if(!out){printf("!out");return;}
fseek(in,0,2);
len=ftell(in);

memcpy(fnt+fnt_len,&fontheader,sizeof(FontHeader));
fnt_len+=sizeof(FontHeader);
fnt_len+=letternum*4;
for(k=0;k<letternum;k++)
{
seek=len-k*bmp_width*height;
for(j=0;j<height;j++)
for(i=0;i<bmp_width;i++)
{
seek--;
if((len-seek)%16==1||(len-seek)%16==2)continue;
fseek(in,seek,0);
buf[bmp_width-1-i][j]=fgetc(in);
}
for(j=0;j<height;j++)
{
for(i=0;i<width;i++)
printf("%2x",buf[i][j]);
printf("\n");
}
}
}
*/
Need help to translate War2Combat to German, French, Italian, Polish or another language: http://forum.war2.ru/index.php/topic,4728.0.html
Please, contact me if you are interested in that.

Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1653
    • View Profile
Re: War2 fonts (.fnt)
« Reply #4 on: February 23, 2019, 11:35:18 AM »
Created a repository for previously created and now rewritten utility for blizzard (war2) font:
https://bitbucket.org/ilwar2/fontblizzard

It's just a 1-st step, i planned to make something useful to work with, but i still have no time, so commited it as is. Only reading the font content and print it to stdout.
« Last Edit: February 23, 2019, 11:50:22 AM by iL »
Need help to translate War2Combat to German, French, Italian, Polish or another language: http://forum.war2.ru/index.php/topic,4728.0.html
Please, contact me if you are interested in that.

Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1653
    • View Profile
Re: War2 fonts (.fnt)
« Reply #5 on: February 23, 2019, 04:14:15 PM »
@easycompany
Where are your posts with your projects you shared here?
Sad to not see them anymore...
Need help to translate War2Combat to German, French, Italian, Polish or another language: http://forum.war2.ru/index.php/topic,4728.0.html
Please, contact me if you are interested in that.

Offline WarKid

  • Peon
  • **
  • Posts: 35
    • View Profile
Re: War2 fonts (.fnt)
« Reply #6 on: February 26, 2019, 06:35:40 AM »
Just courious, why are you trying to edit the fonts? To translate perhaps?  ???

Offline Lambchops

  • Ogre Mage
  • ********
  • Posts: 1541
    • View Profile
Re: War2 fonts (.fnt)
« Reply #7 on: February 26, 2019, 07:15:06 AM »
ok look at this no beer..any ideas?   this is what i was running into last time..
its wierd cause i can draw in the paint prog and it will still be ok in game.

ec if you post the fnt file your playing with here i'll have a look at it ... saves me having to mess around with mpq extractors (lazybones).
its gooder to hax hard and NEVER get caught!

Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1653
    • View Profile
Re: War2 fonts (.fnt)
« Reply #8 on: February 26, 2019, 03:00:34 PM »
Just courious, why are you trying to edit the fonts? To translate perhaps?

My part was to make russian fonts for war2 bne. Russian fonts from war2td are not compatible with bne (different charset as i remember). So, i had to find every letter in dos war2 font and set it to proper place.
My next step is to fix existing russian fonts.
They are beautiful, but russian letters have no shadow. Also, +1 letter required to add.
That's why i need a program to work with fonts.
Also, that program will be required only once, to make several beautiful russian fonts. But why not to share is to community?

http://www.stormcoast-fortress.net/cntt/formats/font/ = prob the same as war2

Yes, the structures are the same. I don't remember where i got that format and it's description years ago when i wrote the 1-st version, but it is it.

il has a reader..he just doesn't have time to finish up.

Yes, i planned to get +2-3 days to finish writer, but then real life and work stole my time as usual... :)
Need help to translate War2Combat to German, French, Italian, Polish or another language: http://forum.war2.ru/index.php/topic,4728.0.html
Please, contact me if you are interested in that.

Offline shesycompany

  • Death Knight
  • *********
  • Posts: 3587
  • retired, be in music section
    • View Profile
Re: War2 fonts (.fnt)
« Reply #9 on: February 27, 2019, 01:35:10 PM »
the best thing to do is just a paint box's for each character..they are all diff sizes

Offline Lambchops

  • Ogre Mage
  • ********
  • Posts: 1541
    • View Profile
Re: War2 fonts (.fnt)
« Reply #10 on: February 27, 2019, 09:39:13 PM »
Here's the format:

Font Header is as mentioned in iL's source except for the "DWORD Unk1" at the end.
This is actually the pointer to the pixel data for the first character, but as the first character in this font is 0x20 (decimal 32) which is a SPACE, there is no pixel data, so the pointer is set to 0.

typedef struct   _FontHeader {
   DWORD   Name;      //   Always is "FONT"
   BYTE   LowIndex;           //   Index of first letter in file
   BYTE   HighIndex;           //   Index of the last letter in file
   BYTE   MaxWidth;           //   Maximum width
   BYTE   MaxHeight;           //   Maximum height
} FontHeader;

  -----------------

This is followed by a DWORD file pointer to the pixel data for each character.
So there are (HighIndex-LowIndex)+1 DWORDS

If the pointer is 0 there is no pixel data for that character.

 ----------

Immediately following file pointers is the pixel data ( indexed by the file pointer DWORD array )

The data for each character is as follows:

( from iL's source )
typedef struct  _FontLetterRaw {
   BYTE   Width;      //   Width of the letter
   BYTE   Height;      //   Height of the letter
   BYTE   XOffset;   //   X Offset for the topleft corner of the letter.
   BYTE   YOffset;   //   Y Offset for the topleft corner of the letter.
} FontLetterRaw;

this is followed by the actual pixel data which is encoded like this:

B=Byte

while B>=8 {
   B-=8 // skip 1 pixel (transparent)
}

B = pixel color

 ---------

EXAMPLE: if the bytes are: 9,5,2

9>=8 so skip a pixel
9-8 = 1
5
2

so that would be 4 pixels:

transparent,1,5,2


there are only 4 colors used

1 = yellow ( palette entry 0xC8 )
2 = beige  ( 0xC7 )
4 = brown ( 0xC0 )
5 = black   ( 0x00 )

value 3 is not used in the font you posted - maybe in the others idk.

Would be interesting to see what color is displayed for a 0x03 byte.


I have attached an edited copy of the font file where I have changed a bunch of the pixels in the '3' character to the pixel value of 3.

@easycompany If you want you could try importing that into the game data then type a bunch of 33333333's in game chat and see what color is displayed. IDK maybe its a different color, maybe its nothing, maybe it will even crash - just could be interesting :) (you will have to rename it back to the original name ofc)

If I get time I'll try to write a quick extractor/packer so you can edit them easily (no promises)

« Last Edit: February 27, 2019, 10:05:50 PM by Lambchops »
its gooder to hax hard and NEVER get caught!

Offline shesycompany

  • Death Knight
  • *********
  • Posts: 3587
  • retired, be in music section
    • View Profile
Re: War2 fonts (.fnt)
« Reply #11 on: February 27, 2019, 10:07:06 PM »
i think its yellow if ur orc/white if human..be cool if u could get a font to put in..looks like forever to draw them.

03 is a grey on human, so its probably a shade of beige orc etc

this is all im gonna be doing to mine a chr and a black background   ..fancy looks like it take awhile

lol tried a rus char ..about as good as i can do for that one :D

3 is the number "3"  i can look at "4" and its smaller size to make it so its not really using a 6x10 grid

"0A-0D" there should be one of these in every char somewhere.... i say is making bits move i can do ff and it will split the char in half so something reads here ..but if its black or white it wont matter ...it will then display as to what u have drawn.

and these big symbols with lots of stuff going on looks impossible for the size limit..it would need something that is bigger to draw them.


« Last Edit: February 28, 2019, 02:36:53 AM by easycompany »

Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1653
    • View Profile
Re: War2 fonts (.fnt)
« Reply #12 on: February 28, 2019, 01:30:49 AM »
@Lambchops, thanks, for such detailed format description, i've been too lazy to describe it anywhere, i just hope such format is obvious from my source code.
there are only 4 colors used

1 = yellow ( palette entry 0xC8 )
2 = beige  ( 0xC7 )
4 = brown ( 0xC0 )
5 = black   ( 0x00 )

value 3 is not used in the font you posted - maybe in the others idk.
I also saw 6(instead of 5 for shadow) and even 0(1 or 2 bytes) in other fonts. Not sure if they are not bugs, i didn't load and check that font.

Font Header is as mentioned in iL's source except for the "DWORD Unk1" at the end.
This is actually the pointer to the pixel data for the first character, but as the first character in this font is 0x20 (decimal 32) which is a SPACE, there is no pixel data, so the pointer is set to 0.
You mean that is not a "DWORD Unk1" in font header, but it's an address of 1-st character (which is NULL because it's SPACE)? Same idea, at least everything works after i commented "DWORD Unk1" and used that way to act.

If I get time I'll try to write a quick extractor/packer so you can edit them easily (no promises)
look at my code: extractor is already working (still not sure about character with X-offset), packer for that format is next step to finish that program.
Created a repository for previously created and now rewritten utility for blizzard (war2) font:
https://bitbucket.org/ilwar2/fontblizzard
Need help to translate War2Combat to German, French, Italian, Polish or another language: http://forum.war2.ru/index.php/topic,4728.0.html
Please, contact me if you are interested in that.

Offline shesycompany

  • Death Knight
  • *********
  • Posts: 3587
  • retired, be in music section
    • View Profile
Re: War2 fonts (.fnt)
« Reply #13 on: February 28, 2019, 03:09:26 AM »
can people type in game in russian?

meant for text =white/ bg =black...


there we go!
« Last Edit: February 28, 2019, 04:04:40 AM by easycompany »

Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1653
    • View Profile
Re: War2 fonts (.fnt)
« Reply #14 on: February 28, 2019, 04:18:23 AM »
can people type in game in russian?

meant for text =white/ bg =black...
Sure, i spent several days in 2007 or 2008 to translate main russian font (font10x or font12x, i don't remember exactly) to let people use russian font.
If your combat contains russian, you can type and see russian, otherwise you can't.
Need help to translate War2Combat to German, French, Italian, Polish or another language: http://forum.war2.ru/index.php/topic,4728.0.html
Please, contact me if you are interested in that.