Repository navigation
fonts.tbl
Revision information OFP Revision: #118 Set the revision to your PR when your PR changes what this page documents. Leave it alone for edits that only fix or improve the documentation.
The fonts.tbl defines the fonts the game can use. The HUD gauges, the show-subtitle-text SEXP, the fiction viewer and many other places can be set to any font in fonts.tbl. Other text (such as the tech room) uses one of the first three fonts.
The engine has a built-in fonts.tbl, used when the mod has none.
This table is one of the Modular Tables and can be extended with xxx-fnt.tbm.
Code: /graphics/software/font.cpp. See Tables for every table.
Badges show the version a field or behavior was added in.
Field index (every field, one per line in table order; click one to jump to it)
- Begins with #Fonts and ends with #End.
- Across all tables, at least 3 fonts must load, or the game stops with an error.
- A font's fields must be in the order listed here; one out of order is not read.
- A font that fails to load is an error, and the table moves on to the next font.
Currently, there are two different types of supported fonts. The old "VFNT" type (which probably means Volition Font) and the new TrueType fonts. The old font use the usual $Font: option while the new fonts use $TrueType:. TrueType fonts can be TTF or OTF.
- Lists a font file to use.
- This font type is not supported if the engine is in Unicode text mode! Such fonts are skipped, with a warning listing them in the log.
- Syntax: String
- Sets the name of this font. Defaults to the specified filename if not provided. (Names of these fonts aren't checked for duplicates.) Be aware that using a number as the name makes referring to the font by name impossible, as numbers are parsed as the font index not the font name.
- Syntax: String
- Specifies the index of the first special character (e.g., infinity symbol, "match speed" icon) in the font. Must be within the range of 0-248; a value outside it logs a warning. Does not apply to language entries below that use +Special Character Index:.
- Syntax: Integer
Note: If this parameter is used with the first font, it will override all uses of +Special Character Index: in strings.tbl.
- Specifies the name of a language. Any number of these can follow, each with its own index.
- Currently used for overriding the value of +Default Special Character Index:.
- A language that isn't built in or defined in strings.tbl logs a warning and is skipped.
- Syntax: String
- Overrides the value of +Default Special Character Index: for this language. Must be 0-248; anything else is an error.
- Syntax: Integer
- Tells FSO to try to automatically scale this font to match the screen resolution. Also accepted without the colon, as
+Auto Size. - Syntax: Boolean
- Tells FSO that this font can scale with the Font Size option available to the player in In-Game Options.
- Syntax: Boolean
- Specifies the top offset for this font. See Top and Bottom offsets for more information.
- Syntax: float
- Specifies the bottom offset for this font. See Top and Bottom offsets for more information.
- Syntax: float
- The width of a tab character.
- Default: 20
- Syntax: float, pixels before scaling, 0 or more. A negative value is an error and is ignored.
- Lists a font file to use.
- Syntax: String
As of 21.0, this can be OTF in addition to the previously supported TTF.
- Specifies the name of this font, defaults to -. A name already used by another font is an error, and this font is skipped. Be aware that using a number as the name makes referring to the font by name impossible, as numbers are parsed as the font index not the font name.
- Syntax: String
- Specifies the size of the font, defaults to 8.
- Syntax: float, must be greater than 0. Anything else is an error, and 8 is used.
- Tells FSO to try to automatically scale this font to match the screen resolution.
- Syntax: Boolean
- Tells FSO that this font can scale with the Font Size option available to the player in In-Game Options.
- Syntax: Boolean
- Specifies the top offset for this font. See Top and Bottom offsets for more information.
- Syntax: float
- Specifies the bottom offset for this font. See Top and Bottom offsets for more information.
- Syntax: float
- The width of a tab character.
- Default: 20
- Syntax: float, pixels before scaling, 0 or more. A negative value is an error and is ignored.
- Specifies the letter spacing. Defaults to 0.
- Syntax: float, must be greater or equal to 0. A negative value is an error and is ignored.
- Specifies the VFNT file to use for the special characters. FSO uses a few special characters for a few things that are not present in standard TrueType fonts. To fix this you can specify a VFNT file from which these characters are loaded. This defaults to font01.vf which is a default font file from FS2 retail.
- This option not needed and not supported if the engine is in Unicode text mode!
- Note! Pointing this to the fifth font entry or later can cause crashes, especially on standalones.
- Syntax: String
- The index of the first special character in the
+Special Character Font:. Must be 0-248; anything else logs a warning and 0 is used. - Without it, the index set for that font's own entry is used; if that font has no entry, a warning is logged and 0 is used.
- Syntax: Integer
The top and bottom offsets can be used to influence the line spacing for a specific font. Before rendering top offset vertical pixels are skipped. Then the text is rendered and then another bottom offset pixels are skipped.
#Fonts
$Font: font01.vf
$Font: font02.vf
$Font: font03.vf
$TrueType: arial.ttf
+Name: Arial
+Size: 12
#End
In a mission file, the fiction viewer picks a font by name or number:
#Fiction Viewer
$File: [text file]
$Font: [font file]
- "Re: Feature Request: 4th font (especially for fiction viewer)", Hard Light Productions Forums, Hard Light Productions, 24-12-2009. Retrieved on January 28, 2011.
Getting Started
Features
SEXPs
Lua Scripting
Tables
-
Tables
- ai.tbl
- Animation (-anim.tbm)
- armor.tbl
- asteroid.tbl
- autopilot.tbl
- cheats.tbl
- colors.tbl
- controlconfigdefaults.tbl
- coordinate_points.tbl
- credits.tbl
- curves.tbl
- cutscenes.tbl
- Decals (-dcl.tbm)
- default_settings.tbl
- Dynamic SEXPs (-sexp.tbm)
- editor.tbl
- fireball.tbl
- fonts.tbl
- game_settings.tbl
- generated_nebula.tbl
- glowpoints.tbl
- help.tbl
- hud_gauges.tbl
- icons.tbl
- iff_defs.tbl
- intel.tbl
- lighting_profiles.tbl
- lightning.tbl
- mainhall.tbl
- medals.tbl
- messages.tbl
- mflash.tbl
- mission_profiles.tbl
- music.tbl
- nebula.tbl
- objecttypes.tbl
- Particle Effects (-part.tbm)
- post_processing.tbl
- props.tbl
- rank.tbl
- scripting.tbl
- ships.tbl
- sounds.tbl
- species_defs.tbl
- ssm.tbl
- stars.tbl
- strings.tbl
- tips.tbl
- traitor.tbl
- tstrings.tbl
- virtual_pofs.tbl
- weapons.tbl