https://wiki.multimedia.cx/api.php?action=feedcontributions&user=Constchar&feedformat=atomMultimediaWiki - User contributions [en]2024-03-29T05:36:30ZUser contributionsMediaWiki 1.39.5https://wiki.multimedia.cx/index.php?title=Talk:LAF&diff=10215Talk:LAF2008-05-31T07:51:17Z<p>Constchar: /* Possible mistaken information */ Edited a recent post</p>
<hr />
<div>== Possible mistaken information ==<br />
The ''Number of Characters'' field in the preamble may not be that at all because in a couple of<br />
LAF files I have, this number does not match the actual number of characters in the file and therefore<br />
is unable to load properly, if at all.<br />
<br />
I looked at the mysterious files and they do appear to be valid LAF files when compared side-by-side with<br />
LAF files known to load properly.<br />
<br />
I suspect the two unknown fields in the preamble may have something to do with this since those numbers<br />
vary from file to file or they could be a special set of flags or something that affects the way the file<br />
is read. Any other thoughts?<br />
<br />
--[[User:Constchar|Constchar]] 03:51, 31 May 2008 (EDT)</div>Constcharhttps://wiki.multimedia.cx/index.php?title=Talk:LAF&diff=10214Talk:LAF2008-05-31T07:47:15Z<p>Constchar: </p>
<hr />
<div>== Possible mistaken information ==<br />
The ''Number of Characters'' field in the preamble may not be that at all because in a couple of<br />
LAF files I have, this number does not match the actual number of characters in the file and therefore<br />
is unable to load properly, if at all.<br />
<br />
I looked at the mysterious files and they do appear to be valid LAF files when compared side-by-side with<br />
LAF files known to load properly.<br />
<br />
--[[User:Constchar|Constchar]] 03:47, 31 May 2008 (EDT)</div>Constcharhttps://wiki.multimedia.cx/index.php?title=LAF&diff=10213LAF2008-05-31T07:44:46Z<p>Constchar: /* Character Info Table */ Added newly discovered information and detail into the meanings</p>
<hr />
<div>This page is some preliminary in-progress documentation for the LucasArts Font format (LAF).<br />
<br />
== Preamble ==<br />
0x00|Number of characters |4 bytes little endian<br />
0x04|Raw font data size |4 bytes little endian<br />
0x08|Max character width (pixels) |4 bytes little endian<br />
0x0C|Max character height (pixels)|4 bytes little endian<br />
0x10|Unknown |4 bytes little endian<br />
0x14|Unknown |4 bytes little endian<br />
0x18|First character ASCII code |4 bytes little endian<br />
0x1C|Last character ASCII code |4 bytes little endian<br />
<br />
== Character Code Table ==<br />
After the preamble we have a table that contains the ASCII code for each character. Each such code is 2 bytes little endian, and there are as many codes as there are characters. The code at offset <tt>0x20 + (i * 2)</tt> is the ASCII code of the ''i''-th character, starting at <tt>i = 0</tt>.<br />
<br />
== Character Info Table ==<br />
The character code table is followed by a table that contains information about each character. Each information block is 16 bytes, and contains several fields.<br />
There are as many information blocks as there are characters.<br />
The structure of an information block is as follows, with addresses relative to the block's address:<br />
<br />
0x00|Bitmap data offset |4 bytes little endian<br />
0x04|Logical width (pixels)|1 byte<br />
0x05|Unknown |1 byte<br />
0x06|Vertical offset |1 byte signed<br />
0x07|Unknown |1 byte<br />
0x08|Width (pixels) |4 bytes little endian<br />
0x0C|Height (pixels) |4 bytes little endian<br />
<br />
* ''Bitmap data offset'' is the offset relative to the end of the character info table.<br />
<br />
* ''Logical width'' is the amount of space between the X coordinate and the next character, when drawing, as opposed to the ''Width'' field, which is the physical width, of the character's bitmap and it is only used to load the bitmap data itself.<br />
<br />
* ''Vertical offset'' is used to determine where exactly the character should appear vertically, relative to the Y coordinate, and it is usually the negative of the character's physical height.<br />
<br />
== Bitmap Data ==<br />
The character info table is followed by a chunk of bitmap data. The chunk's size is the one advertised in the first field of the Preamble. A character's bitmap size is its <tt>width * height</tt> bytes, where each byte is one pixel color value. The bitmap lines are stored in the intuitive way; that is, the pixels of each line are stored left to right, and the lines are stored from top to bottom.<br />
<br />
[[Category:Game Formats]]</div>Constchar