Sign in to follow this  

ID3DXFont and last letter clipping

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

This topic is 4306 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.

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