edgar-mtz-e / slimdx

Automatically exported from code.google.com/p/slimdx
0 stars 0 forks source link

Direct3D9.Font.MeasureText needs input rectangle. #282

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently MeasureText passes ID3DXFont::DrawText an uninitialized RECT,
however DT_CALCRECT uses this rectangle as the basis for its formatting. 
MeasureText should accept this Rectangle as a parameter.

Plus Direct3D10.Font has no MeasureText.

Cheers.

Original issue reported on code.google.com by kurt.bla...@gmail.com on 17 Jun 2008 at 6:43

GoogleCodeExporter commented 9 years ago
I've only just glanced over the issue, but it occurs to me that it might be 
entirely
bogus for us to be supporting the DT_CALCRECT equivalent flag as an input to the
DrawText/Draw methods -- it duplicates what we have MeasureText for, and 
doesn't even
work properly when supplied with DrawText since the modified rectangle cannot be
returned. 

I suppose another option is that we could make the draw methods always return 
the
rectangle bounding (or that would bound, in the case of DT_CALCRECT) the text, 
rather
than just the height. This would eliminate the need for MeasureText entirely.

Thoughts? I may be talking crazy here, I haven't had enough coffee yet.

Original comment by josh.petrie on 17 Jun 2008 at 4:00

GoogleCodeExporter commented 9 years ago
Ok, so I decided that there's no reason to expose the DT_CALCRECT flag to user 
code, 
since there's nothing useful they can do with it. I deleted that, and added a 
MeasureString overload which takes a rectangle by reference. I believe similar 
changes need to be made on the D3D 10 side, but that should cover it for 9.

Original comment by promit....@gmail.com on 17 Jun 2008 at 7:01

GoogleCodeExporter commented 9 years ago

Original comment by Mike.Popoloski on 7 Jul 2008 at 2:50

GoogleCodeExporter commented 9 years ago
Added a Measure override to D3D10.Font.

Original comment by josh.petrie on 13 Jul 2008 at 6:50