PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

DrawText - clipping at spaces?

InexorableTash · 29 May 2003, 17:42 UTC
gd201b - I'm seeing odd behavior with a particular font when rendering a string containing spaces using DrawText - anything after the first space is not rendered and an error code is returned (GDERR_INVALIDRECT)

This happens regardless of the code path that's using the font, but here's one example:

Code:

TCHAR str[128];
_stprintf(str, TEXT("[%.3f ms / %.3f fps]"), nActualFrameTime, nFrameRate);

hr = backbuffer.DrawText( 10, backbuffer.GetHeight() - m_gbfDialogFont.GetHeight(), str, &m_gbfDialogFont, GDDRAWTEXT_LEFT, 0, NULL, NULL );
Assert( SUCCEEDED(hr) );



If I remove the spaces from the string then everything renders fine. Yes, there's lots of room on the surface.

The font bitmap is actually just a tinted version of the sample font depicted in the "THE ADVANCED FONT FORMAT" section of the GD docs. Other fonts work fine. I can't swear that this is new to GD2 since I'm not sure I actually used this font with spaces.

Any thoughts?
Hi,

Please send me the font at johan.sanneblad@home.se - this issue has been reported by others and I want to know what causes it.

Thanks
Johan