>Download q4font.exe font program
Quake 4 uses a specific font program to generate the font files needed by the GUIs.
To generate fonts:
- Place q4font.exe in a folder alongside of any *.ttf files you wish to import.
From the Start menu, hit Run, type cmd and hit ok to start a DOS command prompt.
Change to the directory that q4font.exe is in. Help on DOS commands
- Enter commands to export your font:
q4font <fontname excluding '.ttf'> -symbol -pointsize <value> -width <value> -height <value>
Example 1: Standard 12 point font export
q4font chain -symbol -pointsize 12 -width 256 -height 128
Example 2: Exports a different *.tga and *.fontdat filename from the source *.ttf name
q4font lowpixel_thin -symbol -pointsize 24 -width 256 -height 128 -out lowpixel
The *.tga and *.fontdat files are saved in a /fonts/ folder inside of the folder where you q4font.exe is located.
The Q4 Font tool uses a Symbol codepage for fonts, which is different than a standard Windows font codepage of MS Latin or Windows ANSI. This means that you cannot take *.ttf files used in Windows programs and use them without modification. Altering a font requires font editing software such as Font Lab or Macromedia Fontographer. Using a standard *.ttf in q4font will result in blank font *.tga's.
When changing a font from Windows ANSI to Symbol, it is important to remember to add blank characters with 0 character width. This means do not copy and paste the space character, create a new character with 0 side bearings. In the images below, these blank characters are illustrated as white squares in the Symbol image. Note the ANSI image has grey squares for completely missing characters instead.
Included below are two different examples of fonts, one in Symbol and the other in Windows ANSI for comparison.
Windows ANSI: marine_ANSI.zip
Typical ANSI codepage: Image from Font Lab
Altered Symbol codepage: Image from Font Lab
The list of fonts is populated when the GUIEditor is started, so if you add a font you must restart the GUIEditor. Add fonts to the following folder within Quake4: