Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 281316 Details for
Bug 558586
Printed font size depends on monitor DPI
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
SWT snippet to reproduce the problem with.
TestPrint.java (text/x-java), 2.02 KB, created by
Simeon Andreev
on 2019-12-23 06:32:44 EST
(
hide
)
Description:
SWT snippet to reproduce the problem with.
Filename:
MIME Type:
Creator:
Simeon Andreev
Created:
2019-12-23 06:32:44 EST
Size:
2.02 KB
patch
obsolete
>/******************************************************************************* > * Copyright (c) 2019 Advantest. All rights reserved. > * > * Contributors: > * Advantest - initial API and implementation > *******************************************************************************/ > >package swt.problems; > >import org.eclipse.swt.SWT; >import org.eclipse.swt.graphics.Font; >import org.eclipse.swt.graphics.GC; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.printing.PrintDialog; >import org.eclipse.swt.printing.Printer; >import org.eclipse.swt.printing.PrinterData; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; > >/** > * @author mweidler > * > */ >public class TestPrint { > > public static void main(String[] argv) { > showPrintDialogAndPrint(); > } > > private static void showPrintDialogAndPrint() { > final Display display = new Display(); > Shell shell = new Shell(display); > shell.setSize(400, 250); > shell.setLayout(new FillLayout()); > shell.setText("Bug"); > > PrintDialog dialog = new PrintDialog(shell); > PrinterData printerData = dialog.open(); > if (printerData == null) { > return; > } > > // Do the printing in a background thread so that spooling does not freeze the UI. > Printer printer = new Printer(printerData); > Thread printingThread = new Thread("Print HelloWorld") { > @Override > public void run() { > print(printer); > printer.dispose(); > } > }; > printingThread.start(); > } > > private static void print(Printer printer) { > boolean jobHasStarted = printer.startJob("TestPrint"); > if (jobHasStarted == false) { > return; > } > > GC gc = new GC(printer); > > printer.startPage(); > > Font deviceFont = new Font(printer, "Liberation", 12, SWT.BOLD); > gc.setFont(deviceFont); > > gc.drawText("hello world", 0, 0); > > printer.endPage(); > printer.endJob(); > > gc.dispose(); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 558586
: 281316