ID3DXFont and DT_WORDBREAK

Hi,

DrawText() in DX9 does not work the same way as DrawText() in GDI does when used with the DT_WORDBREAK flag. Punctuation marks in DX9 are wrapped incorrectly:

This is a small text
. The full stop is
wrapped onto the
new line.

Parenthesis are also wrapped although there is no whitespace between the parenthesis and the preceding word:

This is another (bla bla
) text.

This behaviour can be seen in the Text3D sample of the SDK when the window is resized.

Does Microsoft know about this problem? Is there a workaround for this?

Thanks,
Roman

[587 byte] By [GSXP] at [2008-2-25]
# 1
GSXP wrote:
DrawText() in DX9 does not work the
same way as DrawText() in GDI does when used with the DT_WORDBREAK flag. Punctuation marks in DX9 are wrapped incorrectly:
...
Does Microsoft know about this problem?

Possibly, but you should send a bug report to directx@microsoft.com to make sure.
GSXP wrote:
Is there a workaround for this?

Other than doing the word wrap yourself, not that I know of.
RossRidge at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 2
We are aware of this issue because it is a result of using the Uniscribe APIs to perform word breaks. We currently do not have plans to fix this issue, but you can work around it by performing the line breaks yourself using DT_CALCRECT and some cleverness to figure out how big your font is relative to your rect size

-Kutta
Direct3D, Microsoft Corporation

KuttaSrinivasan at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...
# 3

Ummm. I realize it's been a year, but do you mean to tell me that you know your "be all and end all" word layout engine can't handle simple things like comma and apostrophe and you're not going to fix it? Urm, doesn't that strike you as unacceptable? What's the point of providing the API if it gives the wrong answer in extremely common cases? Word breaking between a word and the following comma is just plain wrong. So is breaking "I've" at the apostrophe. Any chance you'll reconsider this decision so someone could actually use DrawText?

Rick Saada

RickSaada at 2007-9-9 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: Graphics...