Bug 96674 - [Bidi] Printing problems in mirrored mode
Summary: [Bidi] Printing problems in mirrored mode
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact: Felipe Heidrich CLA
URL:
Whiteboard: stalebug
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2005-05-25 14:24 EDT by Pratik Shah CLA
Modified: 2019-08-28 16:45 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pratik Shah CLA 2005-05-25 14:24:28 EDT
Here's the hello world printing snippet modified to be in mirrored mode:

Display display = new Display();
PrinterData data = Printer.getDefaultPrinterData();
if (data == null) {
	System.out.println("Warning: No default printer.");
	return;
}
Printer printer = new Printer(data);
if (printer.startJob("SWT Printing Snippet")) {
	Color black = printer.getSystemColor(SWT.COLOR_BLACK);
	Color white = printer.getSystemColor(SWT.COLOR_WHITE);
	Color red = printer.getSystemColor(SWT.COLOR_RED);
	Rectangle trim = printer.computeTrim(0, 0, 0, 0);
	Point dpi = printer.getDPI();
	int leftMargin = dpi.x + trim.x; // one inch from left side of paper
	int topMargin = dpi.y / 2 + trim.y; // one-half inch from top edge of 
paper
	GC gc = new GC(printer, SWT.RIGHT_TO_LEFT);
	Font font = gc.getFont(); // example just uses printer's default font
	if (printer.startPage()) {
		gc.setBackground(white);
		gc.setForeground(black);
		String testString = "Hello World!";
		Point extent = gc.stringExtent(testString);
		gc.drawString(testString, leftMargin, topMargin + 
font.getFontData()[0].getHeight());
		gc.setForeground(red);
		gc.drawRectangle(leftMargin, topMargin, extent.x, extent.y);
		printer.endPage();
	}
	gc.dispose();
	printer.endJob();
}
printer.dispose();
display.dispose();
Comment 1 Pratik Shah CLA 2005-06-03 14:38:58 EDT
Any chance of this getting fixed for 3.1?
Comment 2 Felipe Heidrich CLA 2005-06-03 14:58:14 EDT
It worked here. It printed, in the top-right corner of the page, the text "!
Hello World" and a box around it. What output did you get ?
Comment 3 Randy Hudson CLA 2005-06-03 16:59:58 EDT
I get right alignment, but I am seeing:
"Hello World!"
Comment 4 Felipe Heidrich CLA 2005-06-03 17:19:36 EDT
So this is like Bug 94496 but in the printer ?
Comment 5 Pratik Shah CLA 2005-06-03 17:20:27 EDT
Hmm, it seems this is printer dependent.

On one printer I see what you see, except the string is "Hello World!" instead 
of "!Hello World".  Randy's getting the same output on that printer.  On 
another printer, I am seeing this (along the left edge of the paper):

-------------
|           |Hello World!
-------------
Comment 6 Felipe Heidrich CLA 2009-08-19 12:19:00 EDT
Your bug has been moved to triage, visit http://www.eclipse.org/swt/triage.php for more info.
Comment 7 Leo Ufimtsev CLA 2017-08-03 12:26:20 EDT
This is a one-off bulk update. (The last one in the triage migration).

Moving bugs from swt-triaged@eclipse to platform-swt-inbox@eclipse.org and adding "triaged" keyword as per new triage process:
https://wiki.eclipse.org/SWT/Devel/Triage

See Bug 518478 for details.

Tag for notification/mail filters:
@TriageBulkUpdate
Comment 8 Eclipse Genie CLA 2019-08-28 16:45:15 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.

--
The automated Eclipse Genie.