From:http://www.gamedev.net/topic/284560-bmfont-and-how-to-interpret-the-fnt-file/
Yes, this is the right place for your question.
I've never gotten around to writing any tutorial or sample for using the font file. I should probably do that as it would make the tool more valuable.
Here's a short description of each attribute in the .fnt file.
lineHeight: is how much to move the cursor when going to the next line.
base: this is the offset from the top of line, to where the base of each character is.
scaleW and scaleH: This is the size of the texture.
pages: gives how many textures that are used for the font.
id: is the character number in the ASCII table.
x, y, width, and height: give the position and size of the character image in the texture.
xoffset and yoffset: hold the offset with which to offset the cursor position when drawing the character image. Note, these shouldn't actually change the cursor position.
xadvance: is how much the cursor position should be moved after each character.
page: gives the texture where the character image is found.
Here's some pseudo code for rendering a character:
// Compute the source rect Rect src; src.left = x; src.top = y; src.right = x + width; src.bottom = y + height; // Compute the destination rect Rect dst; dst.left = cursor.x + xoffset; dst.top = cursor.y + yoffset; dst.right = dst.left + width; dst.bottom = dst.top + height; // Draw the image from the right texture DrawRect(page, src, dst); // Update the position cursos.x += xadvance;
I hope that explains it.
I'll look into the bug. Thanks for letting me know.
Regards,
Andreas
[edit] fixed the pseudo code as Sly pointed out [/edit]
[Edited by - WitchLord on November 25, 2004 8:00:15 AM]