Advertisement

BMFont Base variable

Started by September 05, 2009 11:00 AM
1 comment, last by android_808 15 years, 2 months ago
I'm currently writing my own cross-platform font generator for a small project using FreeType. As a method of testing the output I decided to make the program generate a BMFont compatible text file, containing face info, char count, stretchH etc. in addition to the binary output created for the project. For the life of me I can't work out how to get a working value for Base though. I must apologise if this is a stupidly simple question but I've never used FreeType of BMFont before. Reading through the examples, I don't think it is necessary for rendering but I'd like to produce it for the sake of it being complete. Any ideas?
I don't use FreeType in BMFont so I don't know how you get the value for base with that, but with GDI you do it like this:

TEXTMETRIC tm;GetTextMetrics(dc, &tm);base = tm.tmAscent;


Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement
Thanks for the reply. Using the information you supplied, and a bit of Googling I've managed to find the following method:

header.Base = mFontFace->size->metrics.ascender >> 6;


The computed figure is either exactly the same as that produced by BMFont for the same font or 1 out, so it's good enough for now.

This topic is closed to new replies.

Advertisement