After writing a parser for loading GUI elements from XML files I stumbled upon AngelCode's Bitmap Font Generator. Not only does it create bitmap files from TrueType fonts, but it can also export font character information to XML based .fnt file. I used my existing XML tokenizer, wrote a parser to read .fnt files and wrote OpenGL font renderer that uses the loaded information to properly render text.
Text can be scaled, aligned left, right or centered. You can get the length and height of text in pixels. Not much to it. Still need to implement word wrapping and/or cropping...
You can see some font in action in this video:
No comments:
Post a Comment