Original Post
🔒 Locked
Text Engine
Advertisement
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.
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.
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/
To create the font bitmap, I generally use this:
http://www.lmnopc.com/bitmapfontbuilder/
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement