Bug 310804 - Printing Labels results in the label's text being bigger than shown in UI.
Summary: Printing Labels results in the label's text being bigger than shown in UI.
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Draw2d (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-28 08:27 EDT by Craig CLA
Modified: 2010-05-18 10:12 EDT (History)
3 users (show)

See Also:


Attachments
PrintExample (3.79 KB, text/x-java)
2010-04-28 08:30 EDT, Craig CLA
no flags Details
printExample output (49.53 KB, application/pdf)
2010-05-13 14:29 EDT, Craig CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Craig CLA 2010-04-28 08:27:40 EDT
Build Identifier: 3.5.1.v20090813-1341

I've been trying to print GEF Figures and the text within the GEF figures are always printed out larger than they are actually displayed in the UI.

I tested this with example code off the internet and the same problem occurred.
url for example code:
http://demo.spars.info/j/frameset.cgi?compo_id=171393&mode=frameset&ref=3&method=137&MORPHO=1&location=1111111111111111111&LANG=1

just comment out the line:
Label icon = new Label(new Image(null, PrintExample.class.getResourceAsStream("brazil.ico")));
and where icon was added to figure.
for it to run.

Reproducible: Always
Comment 1 Craig CLA 2010-04-28 08:30:17 EDT
Created attachment 166311 [details]
PrintExample

Run this code to illustrate the problem. Note you don't have to print to paper you can also print to file and the same problem occurs.
Comment 2 Thomas Thuem CLA 2010-05-12 11:29:41 EDT
I occured the same problem on a Windows PC.

It looks that this is actually not a problem specific to printing, instead also when zooming is enabled the font-size does not match exactly and the last letters may disappear (partly).
Comment 3 Craig CLA 2010-05-12 16:37:42 EDT
This is such a show stopper for my company, that I might have to fix it myself if the community doesn't. Heaven help :|
Comment 4 Anthony Hunter CLA 2010-05-12 17:14:58 EDT
I can duplicate this problem with GMF Printing and GMF export to image file which uses the same GEF constructs:

Take a GMF Geoshapes diagram example.
Create a few shapes with different font sizes.
I used Times New Roman and Arial, 10, 24 and 72 points

Print or export to image as a PNG file.

The fonts are chopped both on the top and bottom.

I am using the Helios M7 downloads.
Comment 5 Craig CLA 2010-05-12 17:33:13 EDT
well if GMF is built on top of draw2d then it makes sense. It seems that the problem lies in draw2d
Comment 6 Anthony Hunter CLA 2010-05-12 17:38:35 EDT
(In reply to comment #4)
> I am using the Helios M7 downloads.

The bug occurs back to Ganymede, I raised Bug 312723 for GMF.
Comment 7 Alex Boyko CLA 2010-05-13 11:59:13 EDT
Craig, do you use antialias setting on the Graphics/GC to paint the text?
Comment 8 Craig CLA 2010-05-13 14:29:17 EDT
Created attachment 168436 [details]
printExample output

Well if you see the PrintExample, there is no text anti-aliasing specified. I've attached the output of this example when you print to pdf. 
BTW: This has been tested on windows with the same results.
Comment 9 Craig CLA 2010-05-13 14:31:17 EDT
Alex, does the PrintExample.java show the text 100% if you print it, using the print button on the example?
Comment 10 Alex Boyko CLA 2010-05-14 23:42:01 EDT
No, unlikely 100%. There is a scaling factor calculated for the graphics by PrintFigureOperation, which is based on printer DPI.
So far I only tried this Win 7 and this example is not working on Win 7, just clips most of the figures for some reason.
I'll try this on Win XP next week. It is possible that the problem is with the example.
Comment 11 Craig CLA 2010-05-17 03:46:49 EDT
I've tested it on Windows XP and the example prints 100%. 
It seems to be a problem on Ubuntu (gtk), Windows 7 (from what you have told me) and Windows Vista.
Comment 12 Alex Boyko CLA 2010-05-18 10:12:39 EDT
Win 7 and Vista issues seem to be an SWT Win 7/Vista printing issue: Bug 313357
The symptoms of the Win 7/Vista bug different from this one.
Craig, do you mind trying to write a small SWT snippet for printing a label drawn on the canvas?
I have SLED 10 Linux, but no Ubuntu. If I can't reproduce it with SLED 10, you'd have to try reproducing this in pure SWT on Ubuntu (see snippet for 313357) and if successful, raise a defect against SWT.