Bug 242365 - GC DrawString and DrawText do not allow Rectangles
Summary: GC DrawString and DrawText do not allow Rectangles
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 242414
Blocks:
  Show dependency tree
 
Reported: 2008-07-29 06:33 EDT by Mark Plummer CLA
Modified: 2019-09-06 16:18 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Plummer CLA 2008-07-29 06:33:24 EDT
In order to wrap text using the gc (so that you can use ClearType or AntiAlias hints etc) the GDIPlus.dll has a method called GdipDrawString that takes a GPRECTF rectangle structure to allow wrapping of text. Could you expose it from your gdip class and hence your gc class?

Currently I can use the Label widget without AntiAlias, but can wrap, or write my own Label class and can have AnitAlias but no wrapping.
Comment 1 Mark Plummer CLA 2008-07-29 08:39:51 EDT
This would probably require that a MeasureString overload is provided with a Rect as well.
Comment 2 Steve Northover CLA 2008-07-29 10:12:07 EDT
While this is a valid request for new API in GC, you should be able to get what you want right now using TextLayout.setWidth().
Comment 3 Mark Plummer CLA 2008-07-29 10:52:32 EDT
I am having toruble using the TextLayout with an off screen bitmap. 

I was using an Image, getting its gc, setting advanced to true as well as setTextAntiAlias. Using the TextLayout doesn't seem to draw AntiAlias even on the display.
Comment 4 Steve Northover CLA 2008-07-29 11:30:36 EDT
Can you enter a bug report with a snippet that shows the problem?
Comment 5 Steve Northover CLA 2008-07-29 11:31:09 EDT
... maybe we can fix that bug for you (and others).
Comment 6 Mark Plummer CLA 2008-07-29 12:20:37 EDT
Added as Bug 242414 with Code Snippet
Comment 7 Eclipse Webmaster CLA 2019-09-06 16:18:30 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.