FONTDEFS

From ZDoom Wiki
Jump to: navigation, search

This is lump used to define custom fonts. There are three styles of definitions to be aware of in defining your FONTDEFS lump.

Contents

"DOOMFONT"

The standard message font is called "Smallfont" or "Doomfont" in ACS. You can replace the smallfont by creating a new font with the name SMALLFNT. Otherwise, it is created from a collection of existing separate lumps. Doom and Strife feature STCFNxyz lumps, where xyz are the decimal number for the character's ASCII code (e.g., 'A' is STCFN065). Strife also feature an alternate font, SmallFont2, created in the same way from the STBFNxyz lumps. In other games, SmallFont2 is just an alias for SmallFont. In Heretic and Hexen, it is created from the FONTAxy lumps, where xy are the character's ASCII code minus 32 (e.g., 'A' is FONTA33).

Notes: Doom's character STCFN121 does not actually correspond to 'y' but to '|', which should be STCFN124; ZDoom remaps it appropriately in consequence, unless the 'x' and 'z' characters (STCFN120 and STCFN122) are also provided. The glyphs in Heretic and Hexen correspond to upper-case characters, even if they look like lower-case characters.

You can use this example as a guide to creating your own fonts.

   FONTNAME
   {
       Template CFONT%03d
   }

Where "FONTNAME" and "CFONT" are names appropriate to your own project. Template means what the name implies: It's used to create the names for the individual lumps, using the same formatting commands as the C function printf applied to the character's ASCII code. Also, lower case characters are possible; just add the CFONT*** lumps for the lower case characters and they will be used automatically, with the following ranges:

A = 65 Z = 90

a = 97 z = 122


** Thanks to Graf Zahl for the information

"STATUSFONT"

This font only needs to contain the characters you need to print the health and armor display.

   STATUSFONT
   {
       0 STTNUM0
       1 STTNUM1
       2 STTNUM2
       3 STTNUM3
       4 STTNUM4
       5 STTNUM5
       6 STTNUM6
       7 STTNUM7
       8 STTNUM8
       9 STTNUM9
       % STTPRCNT
       / STTSLASH
       - STTMINUS    
       NOTRANSLATION 109	// don't touch the shadow color!
   }

NOTRANSLATION excludes certain palette indices from being colorized. NOTRANSLATION is not implemented for regular fonts - only for ones with explicit patches.

** Thanks to Graf Zahl for the information

"INDEXFONT"

The INDEXFONT is just a leftover definition that isn't used. To replace the smaller numbers that display the ammo count on the right hand side of the stat-bar, simply replace the graphic lumps themselves.

   INDEXFONT
   {
       0 STYSNUM0
       1 STYSNUM1
       2 STYSNUM2
       3 STYSNUM3
       4 STYSNUM4
       5 STYSNUM5
       6 STYSNUM6
       7 STYSNUM7
       8 STYSNUM8
       9 STYSNUM9
       NOTRANSLATION 160
   }

See also

Personal tools
Namespaces
Variants
Actions
Navigation
ACS
DECORATE
ZDoom mods
Toolbox