FreeType
How to use FreeType fonts for mod creators.
ET: Legacy clients can directly use FreeType fonts:
- Put the desired
.ttf
font file into the modfonts
folder - In a UI script, specify a
font
,smallFont
, andbigFont
keyword with the TTF font name and point size.
Default fonts and point sizes are:
- ariblk with point size 27
- courbd with point size 30
TrueType and OpenType fonts saved in the fonts
directory will be loaded automatically. By default client loads ariblk.ttf
and courdb.ttf
font files.
Note: All the vanilla Microsoft licensed font files have been replaced by free software fonts (
Arial Black → LiberationSans-Bold
andCourier New → Courier Prime Bold
).
As the original client cannot directly use FreeType fonts, font textures files need to be generated:
Note: This is not needed for ET: Legacy clients.
- Copy the TrueType font files that you want to use to the mod
fonts
directory, e.g. renameDejaVuSans.ttf
tolegacy/ariblk.ttf
andlegacy/courbd.ttf
- Run the game with
+set r_saveFontData 1
. You must specifyr_saveFontData
before the game is started, as it will get reset when you restart the game. - Exit the game and there will be three
.dat
files and at least three.tga
files.
The .tga
files are in 256x256 pages so if it takes three images to render a 24 point font. You will end up with fontname_0_24.tga
through fontname_2_24.tga
.
In further runs of the game, the system will look for these images and data files when a specific point sized font is rendered and loads them for use. You might want to hand touch the font bitmaps.
© ET: Legacy Team