Jump to content
  • Advertisement
Sign in to follow this  
Habba

GDI and fonts

This topic is 4851 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm using GDI function 'DrawText' to draw text on DirectX surface and then the surface is blitted to backbuffer. I got two problems: Look at the picture here - http://koti.mbnet.fi/oalatalo/Fontbug.PNG 1. In upper part of the picture you can see some white text on a background. The problem is, that character tracking (space between characters) is too small and the text looks somewhat messy. Is there a good way to increase the space between characters without increasing the size of fonts? This can be done in Adobe Photoshop atleast. I'm not sure wether it is a normal property or not. 2. Lower part of that picture holds the other problem. Transparent color on the surface (where the text is drawn) is RGB(255,0,198). When the text is drawn, it gets anti-aliased, which alters the colors and... well, you can see the results by yourself. So, can I turn of this anti-aliasing? I'm using GDI (DrawText) and a custom True-type font. Althought my problem contains some DirectX, I decided to post this message here because it's about GDI.

Share this post


Link to post
Share on other sites
Advertisement
I think your biggest problem is that you're using a font which quite frankly is extremely difficult to read.

But that aside, SetTextCharacterExtra will add a fixed amount of space between each character. SetTextJustification will add space to "break" characters - spaces basically.

To turn off anti-aliasing (and Cleartype) specify NONANTIALIASED_QUALITY when creating the font.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anon Mike
I think your biggest problem is that you're using a font which quite frankly is extremely difficult to read.


Agreed, but I'm not the person who decides that.

Anyway, you solved my problems. My MSDN seems to be rather old, there was no mention about nonantialiased_quality...

Thanks again. I really like this place, no matter the problem, it gets solved in no time.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!