402
Platforms
©2000-2008 Tibbo Technology Inc.
Each entry in the code groups table is 8 bytes long and has the following format:
Off
set
*
By
tes
Data
Comment
+0
2
Start_co
de
The first code in the group
+2
2
Num_cod
es
Number of individual character codes in this group
+4
4
Bitmap_a
ddr_offse
t
Address (that falls within the bitmap offset table and
is given with respect to the beginning of the file) at
which the address of the bitmap of the first character
in the code group is stored.
* With respect to the beginning of a particular table entry
For the above example the code groups table will have two entries:
Start
_cod
e
Num_
codes
Bitmap_offset
0030
H
000AH
00000020H
0041
H
001AH
00000048H
Here is how the above data was calculated. Start codes are obvious. Group one
starts with code 0030H because this is the character code of '0'. The second group
starts with the character code of 'A'. It is also easy to fill out the number of codes
in each group: 10 (000AH) for '0'-'9' and 26 (001AH) for 'A'-'Z'.
Bitmap_addr_offset calculation is explained in the next section.
Bitmap offset table
This table has the same number of entries as the total number of characters
included in the font file. Each entry consists of one field -- a 32-bit offset of a
particular bitmap with respect to the beginning of the font file. Now you can see
how we were able to calculate the data for the bitmap_addr_offset field of the
code groups table. The header of the font file has a fixed length of 16 bytes. There
are two code groups in our example, so the code groups table occupies 8x2=16
bytes. This means that the bitmap offset table starts from address 16+16=32
(0020H). Hence, the first entry in the code groups table points at address 0020H.
The first code group contains 10 characters ('0'-'9'). These will "occupy" 10 entries
in the bitmap offset table, which results in 10x4=40 bytes. Hence, the
bitmap_addr_offset field for the second code group is set to 32+40=72 (0048H).
Bitmaps
Each bitmap starts with a single byte that encodes the width of the bitmap in
pixels, followed by the necessary number of bytes representing this bitmap.
Depending on the pixels_per_byte field of the header, each byte of data may
encode just one or several pixels. Additionally, when using more than 1 pixel-per-