Jump to content
  • Advertisement
Sign in to follow this  
ozzerX

ID3DXFont and last letter clipping

This topic is 4517 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

Hi, I'm getting a problem with D3DX9's font wrapper. For a long time things worked well, then of late I've been getting a wierd problem where the edge of the last letter I draw is clipped off for some reason. You can see a screengrab of the problem here: http://www.olinorwell.com/fontprob.jpg I have experimented with the different font options and may have set one of the parameters to something I shouldn't have. Here is my code to create that font: // Large font HRESULT hr = D3DXCreateFont(g_pSystem->m_pDevice, //D3D Device 32, //Font height 0, //Font width FW_BOLD, //Font Weight 1, //MipLevels true, //Italic DEFAULT_CHARSET, //CharSet OUT_DEFAULT_PRECIS, //OutputPrecision ANTIALIASED_QUALITY, //Quality DEFAULT_PITCH|FF_DONTCARE,//PitchAndFamily "Arial", //pFacename, &m_fontLarge); //ppFont I've searched the net and looked at every sample I could find, but none have helped me solve the problem. Can anyone tell me where I'm going wrong? This is really frustrating me as otherwise the fonts working well. Oli

Share this post


Link to post
Share on other sites
Advertisement
my guess is that you are not giving it a big enough rect when you call draw

try this

// this should draw the whole thing ... with no cliping
font->DrawText( pSpriteRenderer, text.c_str(), -1, &bounds, DT_NOCLIP, fontColor );

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!