How to use .TTF fonts in DarkPlaces

2023-07-13 DarkPlaces tutorials kleskby 0 152
Author: kleskby


Want cool modern fonts and utf8 support in your Quake mod? Learn how to use True Type Font in DarkPlaces game engine.

First, find a font that you will use and put it inside the gfx folder of your mod (id1\gfx\font.ttf).
Make sure you have libfreetype-6.dll in the folder where your engine executable is.
Now edit your autoexec.cfg or MenuQC m_init() to execute the following command lines:


 cmd("r_font_disable_freetype 0\n"); //Enable freetype support
 cmd("utf8_enable 1"); //Enable support for non-latin characters
 cmd("r_font_postprocess_outline 1\n"); //Some outline
 cmd("r_font_postprocess_blur 1\n"); //Some blur
 cmd("loadfont default gfx/font 16 scale 1.2\n"); //Loading font for default text
 cmd("loadfont chat gfx/font 16 scale 1.2\n"); //Loading font for chat input
 cmd("loadfont console gfx/font 24 scale 1.2\n"); //Loading font for console text
 cmd("loadfont infobar gfx/font 24 scale 1.2\n"); //Loading font for infobar (text at the bottom of the screen. Execute cmd: "infobar 1 string")
 cmd("loadfont notify gfx/font 16 scale 1.2\n"); //Loading font for text in left up corner
 cmd("loadfont menu gfx/font 16 scale 1.2\n"); //Font for menuqc
 cmd("loadfont sbar gfx/font 64 scale 1.2\n"); //Font for sbar (health, armor, ammo, etc.)
 cmd("loadfont centerprint gfx/font 32 scale 1.6\n");//Font for centerprint (cmd: "cprint string")


Tags: DarkPlaces, quake, tutorial
Owned by kleskby#1837
Telegram
Close

You have no new notifications.


You have no new messages.