Fonts are necessary when rendering text and Starpoint Gemini 2 uses its own methods of defining them.
Available fonts are divided into rasterized font images (*.dds textures) and texture lookup files (*.txt).
Textures are saved in RGBA8 (32bit) format with white letters and transparent background.
Lookup files are composed of 5 columns: Character ID, X & Y top left character coordinates, width, height.
The number of rows matches the number of individual characters in the chosen custom charset.
Fonts are defined in Spg2\Fonts\FontsTable.ftb and are automatically enumerated by their current order starting with 0.
GENERATING FONTS USING BMFont
Starpoint Gemini 2 comes without tools for font generation. There are many ways to to save a standard font as a rasterized texture and we have adjusted our workflow to work with a free desktop application called BMFont which is fairly simple to use.
Highlighting individual letters from the chosen Font and charset will add them to the texture later.
After installing BMFont you can download our default configuration file here.
Every time you start BMFont choose Options and then Load configuration. Pick our SPG2_BMFontConfig.bmfc configuration file and most properties will be set up properly.
When you're happy with your choice you can generate both files by simply choosing the option Save bitmap font as...
If everything went well you should have generated both a single *.dds texture and a single *.fnt file (which you can even open in Notepad as it is a formatted text file).
FONT LOOKUP CONVERSION
Unfortunately, we're not done yet. We need to convert both the content and the extension of the *.fnt file.
That's it! Now You're ready to simply add your font to the batch of existing fonts or overwrite one of them.
- Open the file in Notepad or your favourite plain-text editor.
- Press CTRL+A and then CTRL+X to cut the entire content.
- Open this web application and paste the content into the text input area.
- In the web application, press "Convert to SPG2 format" to receive the corrected format in the yellow area. Copy it and paste it into the *.fnt file.
- Save the *.fnt file.
- Change the extension of the font file to *.txt.
Fonts are implemented through the FontsTable.ftb file. Each font description has an individual section.
||Custom name for the font
||Path to the font texture
||Custom version number
||Path to the font texture lookup file
||The height of the font
||Height of the space between lines