Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Issues with the font in printing(Font ignored in some printers while printing )
Issues with the font in printing [message #1106878] Wed, 11 September 2013 17:08
Jesus   Luna Quiroga is currently offline Jesus Luna QuirogaFriend
Messages: 67
Registered: July 2009
Location: Mexico

I'm using the SWT print API in my RCP application but I'm having some problems.
The prints that I do are very simple, I just print lines of text and I'm setting Courier type to the font so the characters will have the same width.
Basically what I'm doing is this:
  Printer printer = new Printer(printerData);
    if(printer.startJob("Test")) {
	GC gc = new GC(printer);
		if(printer.startPage()) {	        	
		       	gc.setFont(new Font(gc.getDevice(), "Courier",7,SWT.NORMAL));
		        int height = gc.getFontMetrics().getHeight();
			gc.drawString("Lorem Ipsum is simply dummy text.", 200, 200);
                        gc.drawString("Lorem Ipsum is simply dummy text.", 200, 200);

Everything works fine but with some printers the font is ignored, and I can not give the print a format.
I'm using the latest eclipse version 4.3 - keppler to create the application.

Can you help me with this, should I report this as a bug?
Do you have any ideas that could help me to solve this?

Thanks in advance.
Previous Topic:We recommend using SWT to generate images dynamically in large quantities? (web app, no desktop)
Next Topic:Linux: Clicking on Combo looses focus very soon
Goto Forum:

Current Time: Fri Jun 22 23:11:47 GMT 2018

Powered by FUDForum. Page generated in 0.01291 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top