Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 141723

Summary: PrinterGraphics scales the font in an inappropriate way
Product: [Tools] GEF Reporter: Pawel Garbacz <pawel.garbacz>
Component: GEF-Legacy Draw2dAssignee: gef-inbox <gef-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: nyssen
Version: 3.1.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Pawel Garbacz CLA 2006-05-15 03:11:42 EDT
I found recently that PrinterGraphics scales the font set to the graphics when rendering in a strange way:

=== snippet from source code ===
int zoomFontHeight(int height) {
	return (int)
		(height * zoom * Display.getCurrent().getDPI().y / printer.getDPI().y
			+ 0.0000001);
}
=== end of snippet ===

I am wondering why is there such resolution conversion? The Font drawn on a screen having 8-point height should have the same height (8-point, not 8-pixels) drawn on a printer if only it is created for this device!

In my opinion this is a bug that disallows us to treat fonts in the same way neverthless where the strings in this fonts are drawn. I am convinced that simple height * zoom as in the base class would be enough. Oh we could also introduce here the conversion to the Printer device if only the font is not created for this device (cacheable of course).
Comment 1 Alexander Nyßen CLA 2014-08-09 03:50:44 EDT
The fonts used within PrinterGraphics are not obtained from the Printer device, but from the passed in Graphics (see ScaledGraphics constructor), which will be obtained from the Display device. As such, the resolution conversion seems to be necessary. Resolving as invalid.