🎉 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!

BMFont bug

Started by
15 comments, last by Sly 19 years, 3 months ago
I have confirmed that it really is ClearType that is causing the characters to be cropped. And I have also found which registry keys that identify that ClearType is turned on.

Now I just have to see if there is a way I can turn off ClearType temporarily while drawing the texture. It will probably work by changing the registry just before creating the DC and then restore it after releasing the DC again. If that is possible then I will implement it like that, otherwise I will just detect that ClearType is turned on and ask the user to manually turn it off.

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
Do you use CreateFont to create the font? Perhaps you could try changing what you pass in for dwQuality.
Steve 'Sly' Williams  Monkey Wrangler  Krome Studios
turbo game development with Borland compilers
If I remember correctly I do indeed use CreateFont(). (Is there any other way?)

However, I do not believe I will be able to turn off ClearType this way, because I want font smoothing but not ClearType, and I believe that ClearType is turned on by default if you choose font smoothing (if the system has ClearType turned on, that is). I will give it a try though and see what happens.

Thanks for the tip.

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

I haven't used the program in question (sorry), but the way I draw fonts in OpenGL is to use freetype. Since it renders the font from the actual file and doesn't use windows (as it's platform independent), I don't think it'll suffer from clear type (I've never seen any difference when I use cleartype or not, but I haven’t really looked closely!)

There's even a tutorial on nehe's website (here) that shows how to use it in OpenGL.

Hope it's relevant!
FreeType may come in handy if I one day decide to port the program to other platforms than Win32. It's also a good alternative to D3DXFont used by many DirectX developers. Thanks for the link.

For now, I think I can bypass ClearType without too much trouble while still using GDI, I just need to find the time to actually do the tests.

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

I just uploaded BMFont 1.2, which fixes the last known bug.

Steve, you were right in that changing the value for dwQuality resolved the problem. As a bonus I added the option to turn on/off windows font-smoothing manually.

Thanks for all the feedback. If you have any more suggestions, make sure to let me know so that I can make the tool even better.

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

Excellent. I'll give it a go tonight.

Thanks for your prompt help on these bugs.
Steve 'Sly' Williams  Monkey Wrangler  Krome Studios
turbo game development with Borland compilers

This topic is closed to new replies.

Advertisement