Fonts.dat

From GTAMods Wiki
Jump to navigation Jump to search

fonts.dat — this data file first appeared in GTA SA (Grand Theft Auto: San Andreas) and contains information about the “proportional values for fonts,” as referred to in Rockstar’s code comments. These settings allow characters to occupy varying amounts of space, making the text more compact and aesthetically pleasing. More details are described below.

Proportional values

Pururin-fonts.jpg

‘Proportional values’ are numerical values that define the width of each character in the fonts.txd texture atlas, which contains all the font characters’ sprites. These values indicate the pixel distance from the left edge of the character sprite to its right edge, including padding, which provides space for the subsequent character.

Despite the tile width being 32 pixels, a proportional value can exceed this figure without encroaching on the next sprite in the texture atlas. In addition to the padding provided by proportional values, the text has additional spacing between characters, equivalent to the thickness of these characters’ outlines.

In fonts.dat, the pixel distance for characters is applied at the scale they appear in the original fonts.txd, approximately 32 pixels in width and 39 in height, based on the texture atlas’s resolution of 512x512 pixels divided into 16 columns and 13 rows.

In addition to the unique proportional values associated with each of the characters, the file also contains values that will be used in monospace text mode and the width value for the special character in the subfont.

Format

The file is in plain text format, allowing it to be opened with any text editor (like Notepad). Line comments are marked by the character # (number sign), and the inclusion of empty lines is permitted.

This section is incomplete. You can help by fixing and expanding it.

Tools

This section is incomplete. You can help by fixing and expanding it.

See also