🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

BitmapFont - looking for atlas-packing-function

Started by
3 comments, last by openglinator 9 years, 7 months ago

Greetings,

I'm trying to achieve some good uv map packing for an user-created bitmap font.

Can you point me to the name of the file and the name of your packing function?

smile.png

Advertisement

I'm not sure if the algorithm that I use in BMFont is suitable for uv map packing. It works well for bitmap fonts since there is little variation between the sizes of each glyph, but when the sizes vary a lot the algorithm tend to leave a lot of unused space in the texture.

Anyway, the starting point for the packing algorithm I use is in the method CFontPage::AddCharsToPage that you'll find here: http://svn.code.sf.net/p/bmfont/code/trunk/source/fontpage.cpp.

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

This is essentially state of the art, and written by a fellow GameDev member to boot.
http://clb.demon.fi/files/RectangleBinPack.pdf
There's probably ready made code out there... I believe Freetype-GL has an implementation.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

Thanks a lot for the link to that article. I hadn't seen it before. Promptly added to my reference DB :)

I didn't do a detailed read, but I don't think any of the algorithms presented in the article matches what I do in BMFont, though the skyline algorithm does appear to have some similarities.

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

Thanks, folks, that will help along the way! :-)

This topic is closed to new replies.

Advertisement