Results 1 to 6 of 6

Thread: bitmap font hex numbering (redbook example)

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2005
    Posts
    5

    bitmap font hex numbering (redbook example)

    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.


  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,595

    Re: bitmap font hex numbering (redbook example)

    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

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2005
    Posts
    5

    Re: bitmap font hex numbering (redbook example)

    how do you work out what binary pattern a hex value has.

    why is 0xc0 11000000


  4. #4
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,595

    Re: bitmap font hex numbering (redbook example)


  5. #5
    Senior Member Regular Contributor
    Join Date
    May 2000
    Location
    Oxford, England
    Posts
    472

    Re: bitmap font hex numbering (redbook example)

    Originally posted by gs384:
    how do you work out what binary pattern a hex value has.

    why is 0xc0 11000000

    I cheat.
    Code :
    enum BinaryNumber {
       b00000000,
       b00000001,
       b00000010,
       b00000011,
       .
       .
       .
       b11111111
    };
    raster font and glut raster font example

  6. #6
    Junior Member Newbie
    Join Date
    Feb 2005
    Posts
    5

    Re: bitmap font hex numbering (redbook example)

    thanx for the links ill check them out

Similar Threads

  1. Some advise on bitmap/font
    By Mr.Byteside in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-04-2010, 11:38 AM
  2. Bitmap Font Color
    By jqweezy in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 04-16-2008, 10:20 AM
  3. bitmap font tutorial here :-)
    By herc in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 11-01-2002, 10:08 AM
  4. Bitmap font
    By Questions Burner in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 11-16-2001, 08:14 AM
  5. Centering bitmap Font
    By azrin_aris in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 06-20-2000, 10:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean