Sign in to follow this  
_Sigma

Text Engine

Recommended Posts

GDI is very slow.

Most font engines are basically the same. You have an image (or images) that have your font glyphs. You can pre-create it or create it at runtime from a GDI font.

Then when you draw a string you loop through it and for each character you draw/blit the appropriate glyph.

There are numerous optimizations and spiffy additions you can add, but that's the basics. I'd get that working before looking into anything fancier.

Share this post


Link to post
Share on other sites
OK, that sounds bloody slow tho, drawing lets say...100 "letters" per cycle...:(

Or is it more or less faster than one would think? How do you create the font bmp?

cheers

chris

Share this post


Link to post
Share on other sites
It's probably faster than you think. Though as I mentioned that's just a basic implementation. After you get that running you can see how fast it is and then look at possible improvements. The type of optimizations that you would want to use depend a lot on how you're planning on using it. But worry about optimization when you know it's a problem.

To create the font bitmap, I generally use this:
http://www.lmnopc.com/bitmapfontbuilder/

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this