401
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
Header
Contains various information such as the total number of
characters in this font, character height, etc. Also contains
the number of code groups in the code groups table (see
below).
Code groups
table
Contains descriptors of "code groups". Each code group
contains information about a range of codes that has no
"gaps" (i.e. unused codes in the middle). The font file can
have as many code groups as necessary.
Bitmap offset
table
Contains addresses (offsets) of all character bitmaps in the
TRF file. In combination with the code groups table provides
a way to find the bitmap of any specific character.
Bitmaps
Contains all bitmaps of each character included into the font
file. The width of each bitmap is defined individually and is
stored together with the bitmap.
Header format
The header has a fixed length of 16 bytes and stores the following information:
Off
set
*
By
tes
Data
Comment
+0
2
Num_o
f_chars
Total number of characters in this font file
+2
1
Pixels_
per_byt
e
0- eight pixels/byte (1 bit/pixel, no anti-aliasing); 1-
four pixels/byte, 2- two pixels/byte, 3- one pixel/byte.
Modes 1, 2, and 3 are currently not supported; these
modes are for anti-aliasing and will be supported in the
future.
+3
1
Orienta
tion
0- pixels are grouped vertically; 1- pixels are grouped
horizontally (irrelevant when pixels_per_byte=3)
+4
1
Height
Maximum character height in this font, in pixels.
+5
9
<Reserv
ed>
Reserved for future use
+1
4
2
Num_o
f_grou
ps
Number of entries in the code groups table
*With respect to the beginning of the file
Code groups table
This table has variable number of entries. This number is stored in the
num_of_groups field of the header. Each code group represents a range of codes
that contains no gaps (no unused character codes in the middle). For example,
supposing that we have a font that only contains characters '0'-'9' and 'A'-'Z'. This
means that this font file will contain two groups of codes: 0030H through 0039H
('0'-'9') and 0041H through 005AH ('A'-'Z').