| Summary: | PrinterGraphics scales the font in an inappropriate way | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Pawel Garbacz <pawel.garbacz> |
| Component: | GEF-Legacy Draw2d | Assignee: | 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: | |||
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. |
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).