PDA

View Full Version : bitmap font hex numbering (redbook example)



gs384
03-05-2005, 06:00 AM
in the redbook figure 8.1 shows an f as a bitmap.
can someone please explain the use of the hex numbers in the example. Why does it go from 0xc0 to 0x00? what number say would half the lenght of the top of the f be i carnt figure out how the hex is working so that i can plot them myself.

:)

mikael_aronsson
03-05-2005, 07:06 AM
Hi !

You have to look at the binary pattern for the hex number, a hex digit is built up of 4 bits, so 0xf0 has binary bit pattern 11110000, 0xc0 has binary pattern 11000000 and so on, the 1 is "black" pixels and the 0 are "white" pixels in the picture.

Mikael

gs384
03-05-2005, 08:39 AM
how do you work out what binary pattern a hex value has.

why is 0xc0 11000000

:)

mikael_aronsson
03-08-2005, 01:06 AM
http://www.semsim.com/ccna/tutorial/binary-hex/numbers.html

Rob The Bloke
03-09-2005, 02:19 AM
Originally posted by gs384:
how do you work out what binary pattern a hex value has.

why is 0xc0 11000000

:) I cheat.

enum BinaryNumber {
b00000000,
b00000001,
b00000010,
b00000011,
.
.
.
b11111111
}; raster font and glut raster font example (http://robthebloke.org/opengl_programming.html#1)

gs384
03-09-2005, 01:05 PM
thanx for the links ill check them out :)