Sign in to follow this  

[DX9] DrawTextA() distorting text

This topic is 2630 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, first time poster here, be gentle.

When I draw text onto a sprite, some characters gets cropped. You can see for yourself in this screenshot: http://img202.imageshack.us/img202/2895/choppytext.png

The user types on the keyboard and it appears on a "command log". Each line has its own RECT. And each line is drawn in a FOR loop.

As you can see, some characters are "cropped", a vertical line of pixels is sometimes removed.

Someone mentioned to me that the render surface might be smaller then what I need so some pixels gets aliased

code:

D3DXCreateFont(d3ddev,
22,
0,
FW_NORMAL,
0,
false,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
ANTIALIASED_QUALITY,
DEFAULT_PITCH | FF_DONTCARE,
L"Arial",
&dxfont);

and:
dxfont->DrawTextA(d3dspt,ary[k],str[k].length(),&textbox[k],DT_LEFT | DT_VCENTER,D3DCOLOR_ARGB(255, 255, 0, 0));

Any clues?

Share this post


Link to post
Share on other sites
ok, apperantly the "client window" size includes boarders and menu, so I would need to add some extra height and width to compensate. and there is a AdjustWindowRectEx to do so. If only tutorials would include this information :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Tispe
ok, apperantly the "client window" size includes boarders and menu, so I would need to add some extra height and width to compensate. and there is a AdjustWindowRectEx to do so. If only tutorials would include this information :)
And that's one of the many reasons why I hate directxtutorial.com :P

The client area is the "internal" window size:

Share this post


Link to post
Share on other sites

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