home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_200
/
266_01
/
fonts.doc
< prev
next >
Wrap
Text File
|
1990-02-23
|
2KB
|
52 lines
micro PLOX Fonts
The micro PLOX fonts are simple bit-mapped fonts where a string of bits
in memory represents which bits in a given size rectangular area are to
be turned on to form a character. These fonts were designed foremost
to use little memory. The encoding scheme was empirically developed
to be encoded fairly easily on sight and decoded with a simple loop.
Font 1 fits in a 3 wide by 5 high pixel area using 15 bits which fits
nicely in a 16-bit int.
12 13 14 The bits are decoded in the order shown at left.
9 10 11 Since each row is 3 bits they are conveniently
6 7 8 encoded as octal digits where the leftmost bit
3 4 5 has a value of 1, the middle one 2 and the right
0 1 2 one 4.
XX 3 For example, the numeral one is shaped as shown by the
X 2 X's and the octal digit value of each row is shown
X 2 beside the row. The code for the numeral one (ASCII 31)
X 2 then is 032227 where the leading zero denotes octal.
XXX 7
Fifteen bits does not give enough resolution for lower case letters
so only the upper case and standard punctuation symbols from ASCII 0x20,
space, through ASCII 0x5F, the underline, are encoded.
Font 2 was designed to fit in a 5 by 6 area using only 30 bits which
can be encoded by two 16-bit ints.
2 5 8 11 14 This is most conveniently thought of as two 5 by 3
1 4 7 10 13 areas, one on top of the other. Now each column of
0 3 6 9 12 3 bits can be represented by an octal digit where
------------- the bottom bit of a column has a value of one and
2 5 8 11 14 the top bit has a value of 4.
1 4 7 10 13
0 3 6 9 12
75552
XXXX If the uppercase B is to be displayed by a pattern
X X like the X's at left then the octal digits are as
XXXX shown above and below. These would be encoded in the
X X font 2 list as 061117,025557 since each character is
X X built from the lower left corner up and then right.
XXXX
71116
The decoding consists of getting a copy of the int(s) representing
the character in the font and looping to: check each low order bit,
turn on the equivalent pixel if the bit is one, and then shift off
the bit just checked to put the next bit in the low order position.