Home   Help Search Login Register  

Author Topic: Creation of new fonts  (Read 1036 times)

0 Members and 1 Guest are viewing this topic.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Creation of new fonts
« on: 22 Aug 2006, 17:49:08 »


I would like to create new fonts for an addon i am developing.

Nobody as yet seems to have accomplished this.
Finmod was reported of having accomplished this, however when i checked their files, it seems at the most they simply modified an existing font.

The only information i can find is as follows

Quote
Fxy file format description by OFPInternals

(182 total words in this text)
(17 Reads)   



fxy - Font description file, contains records of TCharDescr structures:

// C-style
typedef struct {
  u2  wCharCode;
  u2  wTextureFileNum;
  u2  wX;
  u2  wY;
  u2  wWidth;
  u2  wHeight;
} TCharDescr;

// Pascal-style
TCharDescr = packed record
  wCharCode: Word;
  wTextureFileNum: Word;
  wX: Word;
  wY: Word;
  wWidth: Word;
  wHeight: Word;
end;

There:

wCharCode - character code: 65 for 'A', 32 for SPACE (' ';).

wTextureFileNum - number of texture file:
 if font name is "CourierNewB64" then font description file name is "CourierNewB64.fxy", first texture file is "CourierNewB64-01.paa", second is "CourierNewB64-02.paa". String format is "%s.fxy" for font description file and "%s-%02d.paa" for texture file.

wX, wY - Top-left Corner of char on the texture;

wWidth, wHeight - Width and Height of char on the texture;

Texture used for the font must have following format:
8bit - Brightness (all with 255 value - "white");
8bit - Alpha (255 for character, 0 for space);
(file signature is 0x8080).

For example, font CourierNewB64:
- texture max LOD is 256x256;
- there are 224 chars with code from 32 to 255 in 2 files;
- chars 32-173 located in CourierNewB64-01.paa;
- chars 174-255 located in CourierNewB64-02.paa;
- smallest char is ' ' (code 32), wX=0, wY=0, wWidth=1, wHeight=1;
- biggest char is '_' (code 95), wX=160, wY=128, wWidth=18, wHeight=30.



any help would be greatly appreciated
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Creation of new fonts
« Reply #1 on: 22 Aug 2006, 23:28:37 »
I think the only way to modify fonts is the way FDF has done it, and I don't know whether it works with single AddOns (non-total conversion mod).. :(
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.