Re: svn commit: r591575 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FObj.java

2007-11-03 Thread Andreas L Delmelle

On Nov 3, 2007, at 11:35, [EMAIL PROTECTED] wrote:


Author: adelmelle
Date: Sat Nov  3 03:35:56 2007
New Revision: 591575

URL: http://svn.apache.org/viewvc?rev=591575view=rev
Log:
Added override for FObj.toString() for convenience during debugging.


Just in case someone was wondering: I thought this to be handy. If  
you add a similar method to AbstractLM, it becomes very easy to trace  
a sample FO in a debug session, if you give it an id.



Cheers

Andreas


Dramatic improvement of PDF text painting quality for SVG

2007-11-03 Thread Jeremias Maerki
As you may have see, I've reimplemented the PDFTextPainter which is part
of the PDFTranscoder. All most all text is now painted using PDF text
painting primitives (except for SVG fonts and where filters are used).

The advantages: smaller PDF files, better visible quality, copy/paste
is possible.

Change:
http://svn.apache.org/viewvc?rev=591587view=rev

Implementation notes:
- The text painter has a fallback so it can still paint text with SVG
fonts. Text for which there's no font in FOP's FontInfo object will be
painted using shapes as before.
- I've reenabled the stroke text switch so you can switch to text as
shapes if anything goes bad (which it shouldn't as the new code is
already well tested).
- By default, I've enabled the PDFTrancoder to make use of FOP's font
auto-detection, so no additional configuration should be necessary to
handle most cases.
- During testing I found that at least on Windows, Sun J2SE 6.0_03
doesn't register Type 1 fonts (like Helvetica) in the Java AWT font list.
That can lead to unexpected font substitution.
- On Linux with J2SE 1.5, my client saw some unexpected behaviour in
terms of font selection which may have to do with either Linux itself or
the JVM. We haven't found out. Installing the right fonts and removing
others helped in this situation.
- The above two points are most likely due to the approach I've taken.
The insider will notice that I've extended the StrokingTextPainter which
means that all text is internally built up using shapes but effectively
painted using PDF text by the PDF TextPainter. That way I didn't have to
reimplement a lot of the flow text functionality. Actually, I've managed
to implement all this with next to no changes in Batik itself (just a
nit. Cameron has taken care of my patch. Thanks!). All this naturally
means, I rely on the font metrics from the AWT subsystem and I just
carefully position each glyph at the position where the Stroking
TextPainter would have painted each glyph as shapes. Now, if no
equivalent font is found in the FontInfo object, the result will look
bad: for example, Times text with Arial font metrics. Fortunately, with
font auto-detection this problem usually doesn't appear. The visual
differences between the PNGTranscoder and the PDFTranscoder are minimal.
I've tested the whole W3C SVG 1.1 test suite.
- I've investigated what it would take to hook FontInfo into Batik's
font subsystem. It looked like too much work for the benefit I get. Just
so you know there's still room for improvement, but for now I've
followed the 80:20 rule.

Feedback welcome. And yes, XSL-FO documents with embedded SVG profit
from these changes, too. :-)

Have fun!
Jeremias Maerki



Re: Dramatic improvement of PDF text painting quality for SVG

2007-11-03 Thread Cameron McCormack
Jeremias Maerki:
 As you may have see, I've reimplemented the PDFTextPainter which is part
 of the PDFTranscoder. All most all text is now painted using PDF text
 painting primitives (except for SVG fonts and where filters are used).
 
 The advantages: smaller PDF files, better visible quality, copy/paste
 is possible.

Awesome!  I know many people will be pleased with this.

-- 
Cameron McCormack, http://mcc.id.au/
xmpp:[EMAIL PROTECTED]  ▪  ICQ 26955922  ▪  MSN [EMAIL PROTECTED]