Difference between revisions of "NML:Add font glyphs"

From GRFSpecs
Jump to navigationJump to search
m (moved NML:Add font glpyhs to NML:Add font glyphs: Typo in page title)
(Add notice on block-name)
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
 
A <code style="color:darkgreen">font-glyph</code> block makes it possible to provide sprites for glyphs that don't have sprites in normal TTD. The syntax is as follows:
 
A <code style="color:darkgreen">font-glyph</code> block makes it possible to provide sprites for glyphs that don't have sprites in normal TTD. The syntax is as follows:
   
font_glyph (&lt;font-size&gt;, &lt;base-char&gt;, &lt;image-file&gt;) {
+
font_glyph [&lt;block_name&gt;](&lt;font-size&gt;, &lt;base-char&gt;[, &lt;image-file&gt;]) {
 
[[NML:Realsprites|list of realsprites]]
 
[[NML:Realsprites|list of realsprites]]
 
}
 
}
  +
  +
A <code style="color:darkgreen">&lt;block_name&gt;</code> is optional but required, if you want to define [[NML:Alternative sprites|alternative sprites]] for the sprite block so that it can be referenced there.
   
 
The first parameter (<code style="color:darkgreen">&lt;font-size&gt;</code>) should be an identifier of the font size to use. Valid values are <code style="color:darkgreen">SMALL</code>, <code style="color:darkgreen">NORMAL</code>, <code style="color:darkgreen">LARGE</code> and <code style="color:darkgreen">MONO</code>.
 
The first parameter (<code style="color:darkgreen">&lt;font-size&gt;</code>) should be an identifier of the font size to use. Valid values are <code style="color:darkgreen">SMALL</code>, <code style="color:darkgreen">NORMAL</code>, <code style="color:darkgreen">LARGE</code> and <code style="color:darkgreen">MONO</code>.
Line 11: Line 13:
 
The second parameter (<code style="color:darkgreen">&lt;base-char&gt;</code>) is the number corresponding to the first character to provide a sprite for. Valid values are all unicode code points in the Basic Multilingual Plane (0-0xFFFF)
 
The second parameter (<code style="color:darkgreen">&lt;base-char&gt;</code>) is the number corresponding to the first character to provide a sprite for. Valid values are all unicode code points in the Basic Multilingual Plane (0-0xFFFF)
   
Parameter three <code style="color:darkgreen">&lt;image-file&gt;</code> is a literal (quoted) string that specifies the file where the sprites are located.
+
Parameter three <code style="color:darkgreen">&lt;image-file&gt;</code> (optional) is a literal (quoted) string that specifies the default file where the sprites are located. This may be overridden per-sprite.
   
 
<code style="color:darkgreen">&lt;real-sprites&gt;</code> should be a list of real sprites. The first real sprite will be used for the character with code <code style="color:darkgreen">base-char;</code>, the second for <code style="color:darkgreen">base-char + 1</code> and so on. These sprites should only use colour palette indices 0 (transparent), 1 (foreground), and 2 (shadow).
 
<code style="color:darkgreen">&lt;real-sprites&gt;</code> should be a list of real sprites. The first real sprite will be used for the character with code <code style="color:darkgreen">base-char;</code>, the second for <code style="color:darkgreen">base-char + 1</code> and so on. These sprites should only use colour palette indices 0 (transparent), 1 (foreground), and 2 (shadow).

Latest revision as of 21:26, 3 March 2012

Block Syntax

A font-glyph block makes it possible to provide sprites for glyphs that don't have sprites in normal TTD. The syntax is as follows:

font_glyph [<block_name>](<font-size>, <base-char>[, <image-file>]) {
	list of realsprites
}

A <block_name> is optional but required, if you want to define alternative sprites for the sprite block so that it can be referenced there.

The first parameter (<font-size>) should be an identifier of the font size to use. Valid values are SMALL, NORMAL, LARGE and MONO.

The second parameter (<base-char>) is the number corresponding to the first character to provide a sprite for. Valid values are all unicode code points in the Basic Multilingual Plane (0-0xFFFF)

Parameter three <image-file> (optional) is a literal (quoted) string that specifies the default file where the sprites are located. This may be overridden per-sprite.

<real-sprites> should be a list of real sprites. The first real sprite will be used for the character with code base-char;, the second for base-char + 1 and so on. These sprites should only use colour palette indices 0 (transparent), 1 (foreground), and 2 (shadow).