|
For now, Stunt Mania uses bitmapped fonts. I am unwilling to speculate on whether that will remain
true.
Each font is based upon a single font texture, and a list of offsets into that texture at which the
various characters may be found. A font texture is an alpha channel only. Every font is declared
with a font start chunk :
[standard chunk header - type is 0x0300]
|
Offset
|
Length
|
Description
| |
0
|
4
|
Font id.
| |
4
|
2
|
font texture width
| |
6
|
2
|
font texture height
| |
8
|
(width * height)
|
font texture. Stored as one byte per pixel, which is the alpha component at that position.
|
There then follows a list of character declarations which express which characters are present on
the font bitmap and where they are. Character declarations refer to the last declared font. The
form is :
[standard chunk header - type is 0x0301]
|
Offset
|
Length
|
Description
| |
0
|
2
|
Character range start.
| |
2
|
4
|
Character range end.
| |
6
|
(1 + range start - range end)*8
|
Character position information. Contains the following info (measured in pixels) :
-
2 bytes - start x position for this character
-
2 bytes - start y position for this character
-
2 bytes - width of this character
-
2 bytes - height of this character
The first one of these records relates to the character 'character range start', the next
to 'character range start+1', and so on. Characters 0x20-0x7f (inclusive) are considered to
be the ASCII standards. Beyond this I have not yet decided.
|
NB due to a typo in my font creation program, the most recent set of release data files has these
chunks as 0x0200 & 0x0201, clashing with object declarations. This is a short term error!
|