Version 2 (modified by sanderd17, 10 years ago) ( diff )

--

Font Builder 2 is the new iteration of the old Font Builder.

This font builder is a python script that converts font files into pre-rendered glyph collections to be used in the game. This means fonts have to be pre-rendered for all combinations of styles (bold, italic, different sizes ...) that are used in the game. These glyph collections get a certain name that can be used in the GUI system.

Fonts are compiled by just running the fontbuilder.py script with python2.

Adding new fonts or replacing fonts

To add a new font, you place the font files in the binaries/data/tools/fontbuilder/fonts directory. Then you modify the fontbuilder.py script to render those fonts. The font variations are controlled near the end of the file. Note that, unless you're redesigning the entire GUI, the names in the fonts array still need to contain all names used in the GUI files.

Adding new glyphs to existing fonts

Not all glyphs available in the fonts are pre-rendered. This is to save space for those glyphs we don't need anyway. The glyphs that get rendered are in the charset.txt as a table with the Unicode code point, the actual symbol, and the name of the symbol (see the unicode chartable). When a glyph is added, you just need to render the fonts again.

Note: See TracWiki for help on using the wiki.