Bug 237957 - StyledTextPrintOptions should include margins
Summary: StyledTextPrintOptions should include margins
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 188006 (view as bug list)
Depends on:
Blocks: 188006
  Show dependency tree
 
Reported: 2008-06-20 12:06 EDT by Peter Centgraf CLA
Modified: 2019-09-06 15:31 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Centgraf CLA 2008-06-20 12:06:38 EDT
StyledText.Printing includes this extremely frustrating bit of hard-coded logic, starting at line 401:

// one inch margin around text
clientArea.x = dpi.x + trim.x; 				
clientArea.y = dpi.y + trim.y;
clientArea.width -= (clientArea.x + trim.width);
clientArea.height -= (clientArea.y + trim.height);

I was very surprised to see this sort of "magic number" logic in SWT.  This should be configurable in the StyledTextPrintOptions with an intelligent default (1 inch, for backwards compatibility).  Currently, there is no way to control the margins without forking half of the swt.custom package.

Here's an example of the impact:  I was planning to use StyledText to render text for printing on a label with a total size of 1.25" x 2.25".  This bug makes it impractical.
Comment 1 Felipe Heidrich CLA 2008-06-20 17:42:19 EDT
*** Bug 188006 has been marked as a duplicate of this bug. ***
Comment 2 Eclipse Webmaster CLA 2019-09-06 15:31:43 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.