Difference between revisions of "Fonts.tbl"
(Added documentation of new parameters added in revision 11151) |
(Add documentation for new font table including True Type fonts.) |
||
Line 1: | Line 1: | ||
{{SCP_table}} | {{SCP_table}} | ||
− | {{ | + | {{TableVersionGit|2016-08-02|b4db345}} |
− | The '''fonts.tbl''' is a recent addition to the SCP allowing the definition of non-standard fonts. | + | The '''fonts.tbl''' is a recent addition to the SCP allowing the definition of non-standard fonts. The number of possible fonts is unlimited. The HUD gauges, show-subtitle-text sexp and the [[Fiction Viewer|fiction viewer]] can be manually set to any font in fonts.tbl. The rest of the fonts used in FSO (e.g. techroom text) are hardcoded to one of the first three fonts that are parsed. |
+ | This table is one of the [[Modular Tables]] and can be extended with xxx-fnt.tbm | ||
[[Tables|List of Tables]] | [[Tables|List of Tables]] | ||
==General Info== | ==General Info== | ||
− | *Begins with #Fonts | + | *Begins with #Fonts |
− | *Consists of 3 | + | *Consists of at least 3 entries |
*Ends with #End | *Ends with #End | ||
+ | |||
+ | Currently, there are two different types of supported fonts. The old "VFNT" type (which probably means '''V'''olition '''F'''o'''nt''') and the new TrueType Fonts. The old font use the usual ''$Font:'' option while the new fonts use ''$TrueType:''. | ||
===$Font:=== | ===$Font:=== | ||
*Lists a font file to use. | *Lists a font file to use. | ||
*Syntax: '''String''' | *Syntax: '''String''' | ||
+ | |||
+ | ====+Name:==== | ||
+ | {{Table38| | ||
+ | *Sets the name of this font. Defaults to the specified filename if not provided. | ||
+ | *Syntax: '''String''' | ||
+ | }} | ||
====+Default Special Character Index:==== | ====+Default Special Character Index:==== | ||
Line 34: | Line 43: | ||
*Syntax: '''Integer''' | *Syntax: '''Integer''' | ||
}} | }} | ||
+ | |||
+ | ====+Top offset:==== | ||
+ | {{Table38| | ||
+ | *Specifies the top offset for this font. See [[Fonts.tbl|Top and Bottom offsets]] for more information. | ||
+ | *Syntax: '''float''' | ||
+ | }} | ||
+ | |||
+ | ====+Bottom offset:==== | ||
+ | {{Table38| | ||
+ | *Specifies the bottom offset for this font. See [[Fonts.tbl|Top and Bottom offsets]] for more information. | ||
+ | *Syntax: '''float''' | ||
+ | }} | ||
+ | |||
+ | ===$TrueType:=== | ||
+ | {{Table38| | ||
+ | *Lists a font file to use. | ||
+ | *Syntax: '''String''' | ||
+ | }} | ||
+ | |||
+ | ====+Name:==== | ||
+ | {{Table38| | ||
+ | *Specifies the name of this font, defaults to '''<fontFilename>-<fontSize>''' | ||
+ | *Syntax: '''String''' | ||
+ | }} | ||
+ | |||
+ | ====+Size:==== | ||
+ | {{Table38| | ||
+ | *Specifies the size of the font, defaults to 8. | ||
+ | *Syntax: '''float''', must be greater than 0 | ||
+ | }} | ||
+ | |||
+ | ====+Top offset:==== | ||
+ | {{Table38| | ||
+ | *Specifies the top offset for this font. See [[Fonts.tbl|Top and Bottom offsets]] for more information. | ||
+ | *Syntax: '''float''' | ||
+ | }} | ||
+ | |||
+ | ====+Bottom offset:==== | ||
+ | {{Table38| | ||
+ | *Specifies the bottom offset for this font. See [[Fonts.tbl|Top and Bottom offsets]] for more information. | ||
+ | *Syntax: '''float''' | ||
+ | }} | ||
+ | |||
+ | ====+Letter spacing:==== | ||
+ | {{Table38| | ||
+ | *Specifies the letter spacing. Defaults to 0. | ||
+ | *Syntax: '''float''', must be greater or equal to 0. | ||
+ | }} | ||
+ | |||
+ | ====+Special Character Font:==== | ||
+ | {{Table38| | ||
+ | *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. | ||
+ | *Syntax: '''String''' | ||
+ | }} | ||
+ | |||
+ | ==Top and Bottom offsets== | ||
+ | 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. | ||
==Sample Entry== | ==Sample Entry== | ||
Line 42: | Line 108: | ||
$Font: font02.vf | $Font: font02.vf | ||
$Font: font03.vf | $Font: font03.vf | ||
+ | |||
+ | $TrueType: arial.ttf | ||
+ | +Name: Arial | ||
+ | +Size: 12 | ||
#End | #End |
Revision as of 11:00, 2 August 2016
This feature requires FreeSpace Open |
Revision information.....
- FSO Git Commit: Date: 2016-08-02 SHA: b4db345
The fonts.tbl is a recent addition to the SCP allowing the definition of non-standard fonts. The number of possible fonts is unlimited. The HUD gauges, show-subtitle-text sexp and the fiction viewer can be manually set to any font in fonts.tbl. The rest of the fonts used in FSO (e.g. techroom text) are hardcoded to one of the first three fonts that are parsed.
This table is one of the Modular Tables and can be extended with xxx-fnt.tbm
Contents
General Info
- Begins with #Fonts
- Consists of at least 3 entries
- Ends with #End
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:.
$Font:
- Lists a font file to use.
- Syntax: String
+Name:
- Sets the name of this font. Defaults to the specified filename if not provided.
- Syntax: String
+Default Special Character Index:
- 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-249. Does not apply to language entries below that use +Special Character Index:.
- Syntax: Integer
+Language:
- Specifies the name of a language.
- Currently used for overriding the value of +Default Special Character Index:.
- Syntax: String
+Special Character Index:
- Overrides the value of +Default Special Character Index: for this language.
- Syntax: Integer
+Top offset:
- Specifies the top offset for this font. See Top and Bottom offsets for more information.
- Syntax: float
+Bottom offset:
- Specifies the bottom offset for this font. See Top and Bottom offsets for more information.
- Syntax: float
$TrueType:
- Lists a font file to use.
- Syntax: String
+Name:
- Specifies the name of this font, defaults to <fontFilename>-<fontSize>
- Syntax: String
+Size:
- Specifies the size of the font, defaults to 8.
- Syntax: float, must be greater than 0
+Top offset:
- Specifies the top offset for this font. See Top and Bottom offsets for more information.
- Syntax: float
+Bottom offset:
- Specifies the bottom offset for this font. See Top and Bottom offsets for more information.
- Syntax: float
+Letter spacing:
- Specifies the letter spacing. Defaults to 0.
- Syntax: float, must be greater or equal to 0.
+Special Character Font:
- 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.
- Syntax: String
Top and Bottom offsets
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.
Sample Entry
#Fonts $Font: font01.vf $Font: font02.vf $Font: font03.vf $TrueType: arial.ttf +Name: Arial +Size: 12 #End
Sample Entry (Fiction Viewer)
#Fiction Viewer $File: [text file] $Font: [font file]
References
- "Re: Feature Request: 4th font (especially for fiction viewer)", Hard Light Productions Forums, Hard Light Productions, 24-12-2009. Retrieved on January 28, 2011.