The fbf fixed-width font format (as far as I can tell) is devised as such: filename = pac.raw image_width = 256 image_height = 64 columns = 32 rows = 8 left = 1 baseline = 7 leading = 1 first_char = 0 char_count = 256 [filename] This is the file containing the image data. It should be a grayscale image, one 8 bit byte per pixel. 0 is opaque, 255 is transparent. [image_width] [image_height] These are the size of the imagedata in the above file in pixels. [columns] [rows] These describe how the sprites are layed out in the above file. The above example shows that there are 32 columns of sprites, and 8 rows. This means that there are 256 sprites total. [left] Where each sprite starts in its space. If you were to draw the text "A" at 0,0, Left will determine where in that sprite the leftmost portion will overlay the 0,0 position. Left = 0 means that all of the pixel data starts after 0,0. Left = 1 means that the first row of pixel data will be off the left of the screen. [baseline] Where the bottom of the sprite starts. If you were to draw the same "A" at 0,0, with a baseline of 7, then just the bottom row of pixels in the font image data will be visible. [leading] How many spaces to put between them. In a nutshell, rendering of the character happens as I have described in the following pseudocode, as far as I can figure out. (assuming fixed width font) void text( string data, int x, int y ) { for( a = 0 ; a < data.length() ; a++ ) { int rX = x + (a * (font.width() + leading)); int rY = y - baseline; drawCharacter( data[a], rX, rY ); } } [first_char] [char_count] These describe the valid range of characters. This will tell the font engine to replace uppercase with lowercase or vice versa depending on which are available. It seems as though the font image data still needs to have the space for all 256 characters though. So if you were to make a font with only 3 valid letters, A-D, then the values should be: first_char = 65 char_count = 4 I think. -------------------------------------------------------------------------------- I have provided a perl script which will read in a binary PGM image file containing the font data. Use XV or Photoshop to show you the example data I have included as well, "pac.pgm". The script will only read in binary PGM files, since the image data in a binary PGM image is the same as what is expected in the .raw file. The perl script is run as such: % perl pgm2fbf.pl The example data contains characters that are 8x8 pixels. If you want the generated font to be named xyzyx, then you'd do the following: % perl pgm2fbf.pl pac.pgm xyzyx 8 8 which should generate two files: xyzyx.fbf xyzyx.raw copy these two files to your sketch's "data" directory to use this font. Just do: BFont myFont = loadFont( "xyzyx.fbf" ); setFont( myFont ); to use the font. Happy hacking! -Jerry Lawrence http://www.cis.rit.edu/~jerry/Software/p5 2003-09-02