Bug 27152 - AWT produces different layout than PDF renderer
Summary: AWT produces different layout than PDF renderer
Status: CLOSED INVALID
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: awt renderer (show other bugs)
Version: 0.20.5
Hardware: PC Windows XP
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-23 10:19 UTC by Peter Schäfer
Modified: 2012-04-01 13:52 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Schäfer 2004-02-23 10:19:13 UTC
Layout from AWT Renderer differs considerably from PDF renderer:
letter spacing is different, line heights are different.

As I understand it, the AWT renderer retrieves font metrics from java.awt.Font.
The PDF renderer uses metrics files that were generated with TTFReader (from the
very same TrueType fonts).

I expect that both methods produce the same result, but they don't !?

It should be possible to use EXACTLY the same metrics info for the AWT Renderer.
Comment 1 Chris Bowditch 2004-02-23 12:24:39 UTC
This is NOT a bug. FOP is working as designed, and yes there are differences 
between AWT and PDF. What about text output, that is very different from PDF, 
but the difference is not a bug, because the differences are to be expected. 
The same is true for AWT.

What we could and should change is the website to explain what users can 
expect from AWT, here:

http://xml.apache.org/fop/output.html#awt
Comment 2 Peter Schäfer 2004-02-23 12:45:52 UTC
I see what you mean.

My problem is this: I would like to include a preview dialog in my application,
and it's very unfortunate when the preview looks different than the resulting PDF.

I would suggest that you either:
 * make metrics files available for AWTRenderer
or
 * make sure that these metrics files are identical to the AWT font metrics

Regards, Peter
Comment 3 Chris Bowditch 2004-02-23 14:32:25 UTC
We do not plan to change AWT renderer to use font metrics, because then AWT 
becomes something else. The way to preview and then print is to generate PDF 
and postscript in a servlet, display the PDF to the user (via HTTP) and send 
your Postscript to the printer. The Postscript and PDF Renderers are designed 
to generate the same output. If you find that this is not the case then it is 
a bug.
Comment 4 Jeremias Maerki 2004-02-23 15:37:26 UTC
If you need a preview, you could have a look at Multivalent 
(http://http.cs.berkeley.edu/~phelps/Multivalent/) which (I think) has a PDF 
viewer in Java under a BSD-style license. I haven't used it so I can't say 
anything about its quality. Another possibility may be to use Eclipse.org's 
SWT which enables you to display Acrobat Reader inside your application just 
as IE and Mozilla and friends can. I heard that it's now possible to use Swing 
inside SWT. Awkward but maybe it helps. Just a couple of ideas...
Comment 5 Peter Schäfer 2004-02-23 16:37:12 UTC
Thanks !!

Multivalent looks really interesting.
Comment 6 Glenn Adams 2012-04-01 13:52:03 UTC
batch transition to closed remaining pre-FOP1.0 resolved bugs