Community

SCI Programming => SCI Development Tools => Topic started by: Cloudee1 on May 23, 2013, 09:55:46 PM

Title: SCI Version 0 Font Resource Specs
Post by: Cloudee1 on May 23, 2013, 09:55:46 PM
By Rainer De Temple

Header
ByteSpecification
0Resource Type(87)
1-3Always 0 (Unused in this type)
4-5Number of chars in font (usually 0x0080)
6-7Height of font (??)
8-?Locations in file of each char - 2 (ie 0x0135 is really 0x137)
?-?Font data

Character
ByteSpecification
0Width of char
1Height of char
2-?Binary data of font, 1 byte per row if width < 0x0A else 2 bytes
Title: Re: SCI Version 0 Font Resource Specs
Post by: Collector on May 24, 2013, 12:56:47 AM
Were these from the help file or have you found some other documentation?
Title: Re: SCI Version 0 Font Resource Specs
Post by: Cloudee1 on May 24, 2013, 05:05:28 PM
Ultimate AGI SCI site of Brian's from the wayback machine. I've got a couple more specs to toss up here when I get a chance. I had them in a word file and I'm getting ready to reformat the laptop so I'm trying to tidy a little when I came across them again.
Title: Re: SCI Version 0 Font Resource Specs
Post by: gumby on June 22, 2013, 04:12:58 PM
The above specs are slightly inaccurate/incomplete.  Here's an example:

Header (in hex)
--------------------
87 00 - font resource type (2 bytes, not one)
00 00 - unused (just 2 unused bytes, always zero)
80 00 - number of chars (little endian - in this case 128 characters)
10 00 - height of font (technically, just the offset of how far do go down to the next 'line' before drawing - in this case 16 pixels)

Character address map
------------------------------
Absolute address of each character in the file.  This section will be 2 bytes per character, so in this case we have 128 * 2 bytes of data.  Note that in a patch resource these addresses will be wrong (off by 2) which is accountable for by the font resource type at the  beginning of the file (87 00).  In a resource archive, these addresses will be spot-on.

In our example, since we have 128 characters the hex address for the first character will be:
06 01 (262 in decimal) - off by two, so the actual location in the patch file is 264.

Character data
-------------------
1 byte for the width of the character
1 bytes for the height of the character
X bytes for binary data for the file.  Computed by multiplying the height by the width divided by 8 (and rounded up).

Example:
0B - width of font - (11 pixels)
10 - height of font - (16 pixels)

16 * (11/8, round up) = 16 * 2 = 32 bytes of data,  each hex value stores 8 pixels of binary font data.