NML:Add font glyphs

From GRFSpecs
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
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).