Advertisement

BitmapFont - looking for atlas-packing-function

Started by October 08, 2014 08:36 AM
3 comments, last by openglinator 10 years 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

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

Advertisement
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