xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vhenneb...@apache.org
Subject svn commit: r1309921 [34/42] - in /xmlgraphics/fop/branches/Temp_TrueTypeInPostScript: ./ examples/embedding/ examples/embedding/java/embedding/ examples/embedding/java/embedding/atxml/ examples/embedding/java/embedding/tools/ examples/plan/src/org/apa...
Date Thu, 05 Apr 2012 16:20:17 GMT
Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/pdf/PDFRenderingUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/pdf/PDFRenderingUtil.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/pdf/PDFRenderingUtil.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/pdf/PDFRenderingUtil.java Thu Apr  5 16:19:19 2012
@@ -35,6 +35,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import org.apache.xmlgraphics.image.loader.util.ImageUtil;
+import org.apache.xmlgraphics.java2d.color.profile.ColorProfileUtil;
 import org.apache.xmlgraphics.xmp.Metadata;
 import org.apache.xmlgraphics.xmp.schemas.XMPBasicAdapter;
 import org.apache.xmlgraphics.xmp.schemas.XMPBasicSchema;
@@ -63,8 +64,9 @@ import org.apache.fop.pdf.PDFPageLabels;
 import org.apache.fop.pdf.PDFReference;
 import org.apache.fop.pdf.PDFText;
 import org.apache.fop.pdf.PDFXMode;
+import org.apache.fop.pdf.Version;
+import org.apache.fop.pdf.VersionController;
 import org.apache.fop.render.pdf.extensions.PDFEmbeddedFileExtensionAttachment;
-import org.apache.fop.util.ColorProfileUtil;
 
 /**
  * Utility class which enables all sorts of features that are not directly connected to the
@@ -102,6 +104,8 @@ class PDFRenderingUtil implements PDFCon
     /** Optional URI to an output profile to be used. */
     protected String outputProfileURI;
 
+    protected Version maxPDFVersion;
+
 
     PDFRenderingUtil(FOUserAgent userAgent) {
         this.userAgent = userAgent;
@@ -124,49 +128,45 @@ class PDFRenderingUtil implements PDFCon
         if (params != null) {
             this.encryptionParams = params; //overwrite if available
         }
-        String pwd;
-        pwd = (String)userAgent.getRendererOptions().get(USER_PASSWORD);
-        if (pwd != null) {
-            if (encryptionParams == null) {
-                this.encryptionParams = new PDFEncryptionParams();
-            }
-            this.encryptionParams.setUserPassword(pwd);
-        }
-        pwd = (String)userAgent.getRendererOptions().get(OWNER_PASSWORD);
-        if (pwd != null) {
-            if (encryptionParams == null) {
-                this.encryptionParams = new PDFEncryptionParams();
-            }
-            this.encryptionParams.setOwnerPassword(pwd);
-        }
-        Object setting;
-        setting = userAgent.getRendererOptions().get(NO_PRINT);
-        if (setting != null) {
-            if (encryptionParams == null) {
-                this.encryptionParams = new PDFEncryptionParams();
-            }
-            this.encryptionParams.setAllowPrint(!booleanValueOf(setting));
-        }
-        setting = userAgent.getRendererOptions().get(NO_COPY_CONTENT);
-        if (setting != null) {
-            if (encryptionParams == null) {
-                this.encryptionParams = new PDFEncryptionParams();
-            }
-            this.encryptionParams.setAllowCopyContent(!booleanValueOf(setting));
-        }
-        setting = userAgent.getRendererOptions().get(NO_EDIT_CONTENT);
-        if (setting != null) {
-            if (encryptionParams == null) {
-                this.encryptionParams = new PDFEncryptionParams();
-            }
-            this.encryptionParams.setAllowEditContent(!booleanValueOf(setting));
-        }
-        setting = userAgent.getRendererOptions().get(NO_ANNOTATIONS);
-        if (setting != null) {
-            if (encryptionParams == null) {
-                this.encryptionParams = new PDFEncryptionParams();
-            }
-            this.encryptionParams.setAllowEditAnnotations(!booleanValueOf(setting));
+        String userPassword = (String)userAgent.getRendererOptions().get(USER_PASSWORD);
+        if (userPassword != null) {
+            getEncryptionParams().setUserPassword(userPassword);
+        }
+        String ownerPassword = (String)userAgent.getRendererOptions().get(OWNER_PASSWORD);
+        if (ownerPassword != null) {
+            getEncryptionParams().setOwnerPassword(ownerPassword);
+        }
+        Object noPrint = userAgent.getRendererOptions().get(NO_PRINT);
+        if (noPrint != null) {
+            getEncryptionParams().setAllowPrint(!booleanValueOf(noPrint));
+        }
+        Object noCopyContent = userAgent.getRendererOptions().get(NO_COPY_CONTENT);
+        if (noCopyContent != null) {
+            getEncryptionParams().setAllowCopyContent(!booleanValueOf(noCopyContent));
+        }
+        Object noEditContent = userAgent.getRendererOptions().get(NO_EDIT_CONTENT);
+        if (noEditContent != null) {
+            getEncryptionParams().setAllowEditContent(!booleanValueOf(noEditContent));
+        }
+        Object noAnnotations = userAgent.getRendererOptions().get(NO_ANNOTATIONS);
+        if (noAnnotations != null) {
+            getEncryptionParams().setAllowEditAnnotations(!booleanValueOf(noAnnotations));
+        }
+        Object noFillInForms = userAgent.getRendererOptions().get(NO_FILLINFORMS);
+        if (noFillInForms != null) {
+            getEncryptionParams().setAllowFillInForms(!booleanValueOf(noFillInForms));
+        }
+        Object noAccessContent = userAgent.getRendererOptions().get(NO_ACCESSCONTENT);
+        if (noAccessContent != null) {
+            getEncryptionParams().setAllowAccessContent(!booleanValueOf(noAccessContent));
+        }
+        Object noAssembleDoc = userAgent.getRendererOptions().get(NO_ASSEMBLEDOC);
+        if (noAssembleDoc != null) {
+            getEncryptionParams().setAllowAssembleDocument(!booleanValueOf(noAssembleDoc));
+        }
+        Object noPrintHQ = userAgent.getRendererOptions().get(NO_PRINTHQ);
+        if (noPrintHQ != null) {
+            getEncryptionParams().setAllowPrintHq(!booleanValueOf(noPrintHQ));
         }
         String s = (String)userAgent.getRendererOptions().get(PDF_A_MODE);
         if (s != null) {
@@ -184,9 +184,10 @@ class PDFRenderingUtil implements PDFCon
         if (s != null) {
             this.outputProfileURI = s;
         }
-        setting = userAgent.getRendererOptions().get(KEY_DISABLE_SRGB_COLORSPACE);
-        if (setting != null) {
-            this.disableSRGBColorSpace = booleanValueOf(setting);
+        Object disableSRGBColorSpace = userAgent.getRendererOptions().get(
+                KEY_DISABLE_SRGB_COLORSPACE);
+        if (disableSRGBColorSpace != null) {
+            this.disableSRGBColorSpace = booleanValueOf(disableSRGBColorSpace);
         }
     }
 
@@ -236,11 +237,14 @@ class PDFRenderingUtil implements PDFCon
     }
 
     /**
-     * Sets the encryption parameters used by the PDF renderer.
-     * @param encryptionParams the encryption parameters
+     * Gets the encryption parameters used by the PDF renderer.
+     * @return encryptionParams the encryption parameters
      */
-    public void setEncryptionParams(PDFEncryptionParams encryptionParams) {
-        this.encryptionParams = encryptionParams;
+    PDFEncryptionParams getEncryptionParams() {
+        if (this.encryptionParams == null) {
+            this.encryptionParams = new PDFEncryptionParams();
+        }
+        return this.encryptionParams;
     }
 
     private void updateInfo() {
@@ -294,7 +298,7 @@ class PDFRenderingUtil implements PDFCon
                 in = new URL(src.getSystemId()).openStream();
             }
             try {
-                profile = ICC_Profile.getInstance(in);
+                profile = ColorProfileUtil.getICC_Profile(in);
             } finally {
                 IOUtils.closeQuietly(in);
             }
@@ -375,8 +379,16 @@ class PDFRenderingUtil implements PDFCon
         if (this.pdfDoc != null) {
             throw new IllegalStateException("PDFDocument already set up");
         }
-        this.pdfDoc = new PDFDocument(
-                userAgent.getProducer() != null ? userAgent.getProducer() : "");
+
+        String producer = userAgent.getProducer() != null ? userAgent.getProducer() : "";
+
+        if (maxPDFVersion == null) {
+            this.pdfDoc = new PDFDocument(producer);
+        } else {
+            VersionController controller
+                    = VersionController.getFixedVersionController(maxPDFVersion);
+            this.pdfDoc = new PDFDocument(producer, controller);
+        }
         updateInfo();
         updatePDFProfiles();
         pdfDoc.setFilterMap(filterMap);
@@ -399,6 +411,9 @@ class PDFRenderingUtil implements PDFCon
             log.debug("PDF/A is active. Conformance Level: " + pdfAMode);
             addPDFA1OutputIntent();
         }
+
+        this.pdfDoc.enableAccessibility(userAgent.isAccessibilityEnabled());
+
         return this.pdfDoc;
     }
 
@@ -482,4 +497,14 @@ class PDFRenderingUtil implements PDFCon
         nameArray.add(new PDFReference(fileSpec));
     }
 
+    /**
+     * Sets the PDF version of the output document. See {@link Version} for the format of
+     * <code>version</code>.
+     * @param version the PDF version
+     * @throws IllegalArgumentException if the format of version doesn't conform to that specified
+     * by {@link Version}
+     */
+    public void setPDFVersion(String version) {
+        maxPDFVersion = Version.getValueOf(version);
+    }
 }

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/pdf/extensions/PDFElementMapping.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/pdf/extensions/PDFElementMapping.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/pdf/extensions/PDFElementMapping.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/pdf/extensions/PDFElementMapping.java Thu Apr  5 16:19:19 2012
@@ -38,7 +38,7 @@ public class PDFElementMapping extends E
     /** {@inheritDoc} */
     protected void initialize() {
         if (foObjs == null) {
-            foObjs = new java.util.HashMap();
+            foObjs = new java.util.HashMap<String, Maker>();
             foObjs.put(PDFEmbeddedFileElement.ELEMENT, new PDFEmbeddedFileMaker());
         }
     }

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/print/PageableRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/print/PageableRenderer.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/print/PageableRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/print/PageableRenderer.java Thu Apr  5 16:19:19 2012
@@ -72,8 +72,14 @@ public class PageableRenderer extends Ja
 
     /**
      * Creates a new PageableRenderer.
+     *
+     * @param userAgent the user agent that contains configuration details. This cannot be null.
      */
-    public PageableRenderer() {
+    public PageableRenderer(FOUserAgent userAgent) {
+        super(userAgent);
+        Map rendererOptions = getUserAgent().getRendererOptions();
+        processOptions(rendererOptions);
+        this.pageFilter = new DefaultPageFilter();
     }
 
     /** {@inheritDoc} */
@@ -81,15 +87,6 @@ public class PageableRenderer extends Ja
         return MimeConstants.MIME_FOP_PRINT;
     }
 
-    /** {@inheritDoc} */
-    public void setUserAgent(FOUserAgent agent) {
-        super.setUserAgent(agent);
-
-        Map rendererOptions = agent.getRendererOptions();
-        processOptions(rendererOptions);
-        this.pageFilter = new DefaultPageFilter();
-    }
-
     private void processOptions(Map rendererOptions) {
         Object o = rendererOptions.get(PageableRenderer.PAGES_MODE);
         if (o != null) {

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/print/PrintRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/print/PrintRenderer.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/print/PrintRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/print/PrintRenderer.java Thu Apr  5 16:19:19 2012
@@ -54,20 +54,12 @@ public class PrintRenderer extends Pagea
     /**
      * Creates a new PrintRenderer with the options set through the renderer options if a custom
      * PrinterJob is not given in FOUserAgent's renderer options.
+     *
+     * @param userAgent the user agent that contains configuration details. This cannot be null.
      */
-    public PrintRenderer() {
-    }
-
-    /**
-     * Creates a new PrintRenderer and allows you to pass in a specific PrinterJob instance
-     * that this renderer should work with.
-     * @param printerJob the PrinterJob instance
-     * @deprecated Please use the rendering options on the user agent to pass in the PrinterJob!
-     */
-    public PrintRenderer(PrinterJob printerJob) {
-        this();
-        this.printerJob = printerJob;
-        printerJob.setPageable(this);
+    public PrintRenderer(FOUserAgent userAgent) {
+        super(userAgent);
+        setRendererOptions();
     }
 
     private void initializePrinterJob() {
@@ -85,11 +77,8 @@ public class PrintRenderer extends Pagea
         }
     }
 
-    /** {@inheritDoc} */
-    public void setUserAgent(FOUserAgent agent) {
-        super.setUserAgent(agent);
-
-        Map rendererOptions = agent.getRendererOptions();
+    private void setRendererOptions() {
+        Map rendererOptions = getUserAgent().getRendererOptions();
 
         Object printerJobO = rendererOptions.get(PrintRenderer.PRINTER_JOB);
         if (printerJobO != null) {

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/print/PrintRendererMaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/print/PrintRendererMaker.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/print/PrintRendererMaker.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/print/PrintRendererMaker.java Thu Apr  5 16:19:19 2012
@@ -35,7 +35,7 @@ public class PrintRendererMaker extends 
 
     /**{@inheritDoc} */
     public Renderer makeRenderer(FOUserAgent userAgent) {
-        return new PrintRenderer();
+        return new PrintRenderer(userAgent);
     }
 
     /** {@inheritDoc} */

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java Thu Apr  5 16:19:19 2012
@@ -42,7 +42,7 @@ import org.apache.fop.svg.AbstractFOPTra
 import org.apache.fop.svg.PDFDocumentGraphics2DConfigurator;
 
 /**
- * This class enables to transcode an input to a PostScript document.
+ * <p>This class enables to transcode an input to a PostScript document.</p>
  *
  * <p>Two transcoding hints (<code>KEY_WIDTH</code> and
  * <code>KEY_HEIGHT</code>) can be used to respectively specify the image
@@ -65,8 +65,7 @@ import org.apache.fop.svg.PDFDocumentGra
  * stylesheet, and <code>KEY_PIXEL_TO_MM</code> to specify the pixel to
  * millimeter conversion factor.
  *
- * @author <a href="mailto:keiron@aftexsw.com">Keiron Liddle</a>
- * @version $Id$
+ * <p>This work was authored by Keiron Liddle (keiron@aftexsw.com).</p>
  */
 public abstract class AbstractPSTranscoder extends AbstractFOPTranscoder {
 
@@ -112,8 +111,9 @@ public abstract class AbstractPSTranscod
         graphics = createDocumentGraphics2D();
         if (!isTextStroked()) {
             try {
+                boolean useComplexScriptFeatures = false; //TODO - FIX ME
                 this.fontInfo = PDFDocumentGraphics2DConfigurator.createFontInfo(
-                        getEffectiveConfiguration());
+                        getEffectiveConfiguration(), useComplexScriptFeatures);
                 graphics.setCustomTextHandler(new NativeTextHandler(graphics, fontInfo));
             } catch (FOPException fe) {
                 throw new TranscoderException(fe);

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/EPSTranscoder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/EPSTranscoder.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/EPSTranscoder.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/EPSTranscoder.java Thu Apr  5 16:19:19 2012
@@ -23,7 +23,7 @@ import org.apache.xmlgraphics.java2d.ps.
 import org.apache.xmlgraphics.java2d.ps.EPSDocumentGraphics2D;
 
 /**
- * This class enables to transcode an input to a EPS document.
+ * <p>This class enables to transcode an input to a EPS document.</p>
  *
  * <p>Two transcoding hints (<code>KEY_WIDTH</code> and
  * <code>KEY_HEIGHT</code>) can be used to respectively specify the image
@@ -46,8 +46,7 @@ import org.apache.xmlgraphics.java2d.ps.
  * stylesheet, and <code>KEY_PIXEL_TO_MM</code> to specify the pixel to
  * millimeter conversion factor.
  *
- * @author <a href="mailto:keiron@aftexsw.com">Keiron Liddle</a>
- * @version $Id$
+ * <p>This work was authored by Keiron Liddle (keiron@aftexsw.com).</p>
  */
 public class EPSTranscoder extends AbstractPSTranscoder {
 

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/FontResourceCache.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/FontResourceCache.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/FontResourceCache.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/FontResourceCache.java Thu Apr  5 16:19:19 2012
@@ -21,10 +21,11 @@ package org.apache.fop.render.ps;
 
 import java.util.Map;
 
+import org.apache.xmlgraphics.ps.PSResource;
+
 import org.apache.fop.fonts.FontInfo;
 import org.apache.fop.fonts.LazyFont;
 import org.apache.fop.fonts.Typeface;
-import org.apache.xmlgraphics.ps.PSResource;
 
 /**
  * A cache for font resource objects.

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/ImageEncoderCCITTFax.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/ImageEncoderCCITTFax.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/ImageEncoderCCITTFax.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/ImageEncoderCCITTFax.java Thu Apr  5 16:19:19 2012
@@ -69,4 +69,4 @@ public class ImageEncoderCCITTFax implem
 
         return dict.toString() + " /CCITTFaxDecode";
     }
-}
\ No newline at end of file
+}

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/ImageEncoderJPEG.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/ImageEncoderJPEG.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/ImageEncoderJPEG.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/ImageEncoderJPEG.java Thu Apr  5 16:19:19 2012
@@ -48,4 +48,4 @@ public class ImageEncoderJPEG implements
     public String getImplicitFilter() {
         return "<< >> /DCTDecode";
     }
-}
\ No newline at end of file
+}

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/NativeTextHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/NativeTextHandler.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/NativeTextHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/NativeTextHandler.java Thu Apr  5 16:19:19 2012
@@ -73,7 +73,8 @@ public class NativeTextHandler implement
     private void setupFontInfo() {
         //Sets up a FontInfo with default fonts
         fontInfo = new FontInfo();
-        FontSetup.setup(fontInfo);
+        boolean base14Kerning = false;
+        FontSetup.setup(fontInfo, base14Kerning);
     }
 
     /**

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSBorderPainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSBorderPainter.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSBorderPainter.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSBorderPainter.java Thu Apr  5 16:19:19 2012
@@ -62,9 +62,10 @@ public class PSBorderPainter extends Bor
     private static void drawLine(PSGenerator gen,
             float startx, float starty, float endx, float endy) throws IOException {
         gen.writeln(gen.formatDouble(startx) + " "
-                + gen.formatDouble(starty) + " M "
+                + gen.formatDouble(starty) + " " + gen.mapCommand("moveto") + " "
                 + gen.formatDouble(endx) + " "
-                + gen.formatDouble(endy) + " lineto stroke newpath");
+                + gen.formatDouble(endy) + " " + gen.mapCommand("lineto") + " "
+                + gen.mapCommand("stroke") + " " + gen.mapCommand("newpath"));
     }
 
     /**
@@ -260,7 +261,8 @@ public class PSBorderPainter extends Bor
                 lineTo(end.x, starty + 2 * half);
                 lineTo(start.x, starty + 2 * half);
                 closePath();
-                generator.writeln(" fill newpath");
+                generator.write(" " + generator.mapCommand("fill"));
+                generator.writeln(" " + generator.mapCommand("newpath"));
                 generator.useColor(color);
                 if (style == RuleStyle.GROOVE) {
                     moveTo(start.x, starty);
@@ -276,7 +278,8 @@ public class PSBorderPainter extends Bor
                     lineTo(end.x - half, starty + half);
                 }
                 closePath();
-                generator.writeln(" fill newpath");
+                generator.write(" " + generator.mapCommand("fill"));
+                generator.writeln(" " + generator.mapCommand("newpath"));
                 break;
             default:
                 throw new UnsupportedOperationException("rule style not supported");
@@ -293,13 +296,13 @@ public class PSBorderPainter extends Bor
     /** {@inheritDoc} */
     protected void moveTo(int x, int y) throws IOException {
         generator.writeln(generator.formatDouble(toPoints(x)) + " "
-                + generator.formatDouble(toPoints(y)) + " M");
+                + generator.formatDouble(toPoints(y)) + " " + generator.mapCommand("moveto"));
     }
 
     /** {@inheritDoc} */
     protected void lineTo(int x, int y) throws IOException {
         generator.writeln(generator.formatDouble(toPoints(x)) + " "
-                + generator.formatDouble(toPoints(y)) + " lineto");
+                + generator.formatDouble(toPoints(y)) + " " + generator.mapCommand("lineto"));
     }
 
     /** {@inheritDoc} */
@@ -314,7 +317,7 @@ public class PSBorderPainter extends Bor
 
     /** {@inheritDoc} */
     protected void clip() throws IOException {
-        generator.writeln("clip newpath");
+        generator.writeln(generator.mapCommand("clip") + " " + generator.mapCommand("newpath"));
     }
 
     /** {@inheritDoc} */

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSDocumentHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSDocumentHandler.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSDocumentHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSDocumentHandler.java Thu Apr  5 16:19:19 2012
@@ -53,7 +53,6 @@ import org.apache.fop.apps.FOUserAgent;
 import org.apache.fop.apps.MimeConstants;
 import org.apache.fop.render.intermediate.AbstractBinaryWritingIFDocumentHandler;
 import org.apache.fop.render.intermediate.IFContext;
-import org.apache.fop.render.intermediate.IFDocumentHandler;
 import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator;
 import org.apache.fop.render.intermediate.IFException;
 import org.apache.fop.render.intermediate.IFPainter;

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java Thu Apr  5 16:19:19 2012
@@ -34,8 +34,8 @@ import org.apache.fop.pdf.PDFFactory;
 import org.apache.fop.render.AbstractGraphics2DAdapter;
 import org.apache.fop.render.ImageHandlerUtil;
 import org.apache.fop.render.RendererContext;
-import org.apache.fop.render.RendererContextConstants;
 import org.apache.fop.render.RendererContext.RendererContextWrapper;
+import org.apache.fop.render.RendererContextConstants;
 
 /**
  * Graphics2DAdapter implementation for PostScript.

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSImageHandlerGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSImageHandlerGraphics2D.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSImageHandlerGraphics2D.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSImageHandlerGraphics2D.java Thu Apr  5 16:19:19 2012
@@ -97,34 +97,14 @@ public class PSImageHandlerGraphics2D im
     }
 
     /** {@inheritDoc} */
-    public void generateForm(RenderingContext context, Image image, PSImageFormResource form)
+    public void generateForm(RenderingContext context, Image image, final PSImageFormResource form)
             throws IOException {
         PSRenderingContext psContext = (PSRenderingContext)context;
         PSGenerator gen = psContext.getGenerator();
         final ImageGraphics2D imageG2D = (ImageGraphics2D)image;
         ImageInfo info = image.getInfo();
-        String imageDescription = info.getMimeType() + " " + info.getOriginalURI();
-        final Dimension2D dimensionsPt = info.getSize().getDimensionPt();
-        final Dimension2D dimensionsMpt = info.getSize().getDimensionMpt();
-
-        FormGenerator formGen = new FormGenerator(
-                form.getName(), imageDescription, dimensionsPt) {
-
-            protected void generatePaintProc(PSGenerator gen)
-                    throws IOException {
-                gen.getResourceTracker().notifyResourceUsageOnPage(
-                        PSProcSets.EPS_PROCSET);
-                gen.writeln("BeginEPSF");
-                PSGraphics2DAdapter adapter = new PSGraphics2DAdapter(gen, false);
-                adapter.paintImage(imageG2D.getGraphics2DImagePainter(),
-                        null,
-                        0, 0,
-                        (int)Math.round(dimensionsMpt.getWidth()),
-                        (int)Math.round(dimensionsMpt.getHeight()));
-                gen.writeln("EndEPSF");
-            }
 
-        };
+        FormGenerator formGen = buildFormGenerator(gen.getPSLevel(), form, info, imageG2D);
         formGen.generate(gen);
     }
     /** {@inheritDoc} */
@@ -150,4 +130,70 @@ public class PSImageHandlerGraphics2D im
         return false;
     }
 
+    private FormGenerator buildFormGenerator(int psLanguageLevel, final PSImageFormResource form,
+            final ImageInfo info, final ImageGraphics2D imageG2D) {
+        String imageDescription = info.getMimeType() + " " + info.getOriginalURI();
+        final Dimension2D dimensionsPt = info.getSize().getDimensionPt();
+        final Dimension2D dimensionsMpt = info.getSize().getDimensionMpt();
+        FormGenerator formGen;
+
+        if (psLanguageLevel <= 2) {
+            formGen = new EPSFormGenerator(form.getName(), imageDescription, dimensionsPt) {
+
+                @Override
+                void doGeneratePaintProc(PSGenerator gen) throws IOException {
+                    paintImageG2D(imageG2D, dimensionsMpt, gen);
+                }
+            };
+        } else {
+            formGen = new EPSFormGenerator(form.getName(), imageDescription, dimensionsPt) {
+
+                @Override
+                protected void generateAdditionalDataStream(PSGenerator gen) throws IOException {
+                    gen.writeln("/" + form.getName() + ":Data currentfile <<");
+                    gen.writeln("  /Filter /SubFileDecode");
+                    gen.writeln("  /DecodeParms << /EODCount 0 /EODString (%FOPEndOfData) >>");
+                    gen.writeln(">> /ReusableStreamDecode filter");
+                    paintImageG2D(imageG2D, dimensionsMpt, gen);
+                    gen.writeln("%FOPEndOfData");
+                    gen.writeln("def");
+                }
+
+                @Override
+                void doGeneratePaintProc(PSGenerator gen) throws IOException {
+                    gen.writeln(form.getName() + ":Data 0 setfileposition");
+                    gen.writeln(form.getName() + ":Data cvx exec");
+                }
+            };
+        }
+        return formGen;
+    }
+
+    private abstract static class EPSFormGenerator extends FormGenerator {
+
+        EPSFormGenerator(String formName, String title, Dimension2D dimensions) {
+            super(formName, title, dimensions);
+        }
+
+        protected void paintImageG2D(final ImageGraphics2D imageG2D, Dimension2D dimensionsMpt,
+                PSGenerator gen) throws IOException {
+            PSGraphics2DAdapter adapter = new PSGraphics2DAdapter(gen, false);
+            adapter.paintImage(imageG2D.getGraphics2DImagePainter(),
+                        null,
+                        0, 0,
+                        (int) Math.round(dimensionsMpt.getWidth()),
+                        (int) Math.round(dimensionsMpt.getHeight()));
+        }
+
+        @Override
+        protected final void generatePaintProc(PSGenerator gen) throws IOException {
+            gen.getResourceTracker().notifyResourceUsageOnPage(
+                    PSProcSets.EPS_PROCSET);
+            gen.writeln("BeginEPSF");
+            doGeneratePaintProc(gen);
+            gen.writeln("EndEPSF");
+        }
+
+        abstract void doGeneratePaintProc(PSGenerator gen) throws IOException;
+    }
 }

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSPainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSPainter.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSPainter.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSPainter.java Thu Apr  5 16:19:19 2012
@@ -52,6 +52,7 @@ import org.apache.fop.render.intermediat
 import org.apache.fop.render.intermediate.IFContext;
 import org.apache.fop.render.intermediate.IFException;
 import org.apache.fop.render.intermediate.IFState;
+import org.apache.fop.render.intermediate.IFUtil;
 import org.apache.fop.traits.BorderProps;
 import org.apache.fop.traits.RuleStyle;
 import org.apache.fop.util.CharUtilities;
@@ -204,7 +205,7 @@ public class PSPainter extends AbstractI
             endTextObject();
             generator.defineRect(rect.x / 1000.0, rect.y / 1000.0,
                     rect.width / 1000.0, rect.height / 1000.0);
-            generator.writeln("clip newpath");
+            generator.writeln(generator.mapCommand("clip") + " " + generator.mapCommand("newpath"));
         } catch (IOException ioe) {
             throw new IFException("I/O error in clipRect()", ioe);
         }
@@ -228,7 +229,7 @@ public class PSPainter extends AbstractI
                 }
                 generator.defineRect(rect.x / 1000.0, rect.y / 1000.0,
                         rect.width / 1000.0, rect.height / 1000.0);
-                generator.writeln("fill");
+                generator.writeln(generator.mapCommand("fill"));
             } catch (IOException ioe) {
                 throw new IFException("I/O error in fillRect()", ioe);
             }
@@ -236,12 +237,17 @@ public class PSPainter extends AbstractI
     }
 
     /** {@inheritDoc} */
-    public void drawBorderRect(Rectangle rect, BorderProps before, BorderProps after,
-            BorderProps start, BorderProps end) throws IFException {
-        if (before != null || after != null || start != null || end != null) {
+    public void drawBorderRect(Rectangle rect, BorderProps top, BorderProps bottom,
+            BorderProps left, BorderProps right) throws IFException {
+        if (top != null || bottom != null || left != null || right != null) {
             try {
                 endTextObject();
-                this.borderPainter.drawBorders(rect, before, after, start, end);
+                if (getPSUtil().getRenderingMode() == PSRenderingMode.SIZE
+                    && hasOnlySolidBorders(top, bottom, left, right)) {
+                    super.drawBorderRect(rect, top, bottom, left, right);
+                } else {
+                    this.borderPainter.drawBorders(rect, top, bottom, left, right);
+                }
             } catch (IOException ioe) {
                 throw new IFException("I/O error in drawBorderRect()", ioe);
             }
@@ -340,9 +346,8 @@ public class PSPainter extends AbstractI
 
     /** {@inheritDoc} */
     public void drawText(int x, int y, int letterSpacing, int wordSpacing,
-            int[] dx, String text) throws IFException {
+            int[][] dp, String text) throws IFException {
         try {
-            //Note: dy is currently ignored
             PSGenerator generator = getGenerator();
             generator.useColor(state.getTextColor());
             beginTextObject();
@@ -370,9 +375,9 @@ public class PSPainter extends AbstractI
                     + " " + formatMptAsPt(generator, y) + " Tm");
 
             int textLen = text.length();
-            if (singleByteFont != null && singleByteFont.hasAdditionalEncodings()) {
+            int start = 0;
+            if (singleByteFont != null) {
                 //Analyze string and split up in order to paint in different sub-fonts/encodings
-                int start = 0;
                 int currentEncoding = -1;
                 for (int i = 0; i < textLen; i++) {
                     char c = text.charAt(i);
@@ -381,7 +386,7 @@ public class PSPainter extends AbstractI
                     if (currentEncoding != encoding) {
                         if (i > 0) {
                             writeText(text, start, i - start,
-                                    letterSpacing, wordSpacing, dx, font, tf, false);
+                                    letterSpacing, wordSpacing, dp, font, tf, false);
                         }
                         if (encoding == 0) {
                             useFont(fontKey, sizeMillipoints);
@@ -392,20 +397,18 @@ public class PSPainter extends AbstractI
                         start = i;
                     }
                 }
-                writeText(text, start, textLen - start,
-                        letterSpacing, wordSpacing, dx, font, tf, false);
             } else {
                 useFont(fontKey, sizeMillipoints);
-                writeText(text, 0, textLen,
-                        letterSpacing, wordSpacing, dx, font, tf, tf instanceof MultiByteFont);
             }
+            writeText(text, start, textLen - start, letterSpacing, wordSpacing, dp, font, tf,
+                    tf instanceof MultiByteFont);
         } catch (IOException ioe) {
             throw new IFException("I/O error in drawText()", ioe);
         }
     }
 
     private void writeText(String text, int start, int len,
-            int letterSpacing, int wordSpacing, int[] dx,
+            int letterSpacing, int wordSpacing, int[][] dp,
             Font font, Typeface tf, boolean multiByte) throws IOException {
         PSGenerator generator = getGenerator();
         int end = start + len;
@@ -418,6 +421,7 @@ public class PSPainter extends AbstractI
         int lineStart = 0;
         StringBuffer accText = new StringBuffer(initialSize);
         StringBuffer sb = new StringBuffer(initialSize);
+        int[] dx = IFUtil.convertDPToDX ( dp );
         int dxl = (dx != null ? dx.length : 0);
         for (int i = start; i < end; i++) {
             char orgChar = text.charAt(i);
@@ -482,9 +486,9 @@ public class PSPainter extends AbstractI
                 spb.append(formatMptAsPt(generator, letterSpacing))
                     .append(" 0 ");
                 sb.insert(0, spb.toString());
-                sb.append(" ashow");
+                sb.append(" " + generator.mapCommand("ashow"));
             } else {
-                sb.append(" show");
+                sb.append(" " + generator.mapCommand("show"));
             }
         }
         generator.writeln(sb.toString());

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java Thu Apr  5 16:19:19 2012
@@ -19,6 +19,8 @@
 
 package org.apache.fop.render.ps;
 
+import java.util.Locale;
+
 import org.apache.avalon.framework.configuration.Configuration;
 
 import org.apache.xmlgraphics.ps.PSGenerator;
@@ -66,6 +68,12 @@ public class PSRendererConfigurator exte
         if (child != null) {
             psUtil.setOptimizeResources(child.getValueAsBoolean(false));
         }
+        child = cfg.getChild("rendering");
+        if (child != null) {
+            psUtil.setRenderingMode(PSRenderingMode.valueOf(
+                    child.getValue(psUtil.getRenderingMode().toString())
+                    .toUpperCase(Locale.ENGLISH)));
+        }
         psUtil.setSafeSetPageDevice(
             cfg.getChild("safe-set-page-device").getValueAsBoolean(false));
         psUtil.setDSCComplianceEnabled(

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSRenderingUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSRenderingUtil.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSRenderingUtil.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSRenderingUtil.java Thu Apr  5 16:19:19 2012
@@ -56,6 +56,12 @@ public class PSRenderingUtil implements 
     /** Determines whether the PS file is generated in two passes to minimize file size */
     private boolean optimizeResources = false;
 
+    /**
+     * Determines whether the generated PostScript code is optimized for minimum file size
+     * of best quality.
+     */
+    private PSRenderingMode renderingMode = PSRenderingMode.QUALITY;
+
     PSRenderingUtil(FOUserAgent userAgent) {
         this.userAgent = userAgent;
         initialize();
@@ -287,5 +293,19 @@ public class PSRenderingUtil implements 
         return optimizeResources;
     }
 
+    /**
+     * Sets the rendering mode.
+     * @param renderingMode the rendering mode
+     */
+    public void setRenderingMode(PSRenderingMode renderingMode) {
+        this.renderingMode = renderingMode;
+    }
 
+    /**
+     * Returns the rendering mode.
+     * @return the rendering mode
+     */
+    public PSRenderingMode getRenderingMode() {
+        return this.renderingMode;
+    }
 }

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSSVGHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSSVGHandler.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSSVGHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSSVGHandler.java Thu Apr  5 16:19:19 2012
@@ -27,6 +27,7 @@ import java.util.Map;
 import org.w3c.dom.Document;
 
 import org.apache.avalon.framework.configuration.Configuration;
+
 import org.apache.batik.bridge.BridgeContext;
 import org.apache.batik.bridge.GVTBuilder;
 import org.apache.batik.gvt.GraphicsNode;

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSTextElementBridge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSTextElementBridge.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSTextElementBridge.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSTextElementBridge.java Thu Apr  5 16:19:19 2012
@@ -28,12 +28,9 @@ import org.apache.batik.gvt.TextNode;
 import org.apache.batik.gvt.TextPainter;
 
 /**
- * Bridge class for the &lt;text> element.
+ * <p>Bridge class for the &lt;text> element.
  * This bridge will use the direct text painter if the text
- * for the element is simple.
- *
- * @author <a href="mailto:fop-dev@xml.apache.org">Apache XML FOP Development Team</a>
- * @version $Id$
+ * for the element is simple.</p>
  */
 public class PSTextElementBridge extends SVGTextElementBridge {
 
@@ -65,4 +62,3 @@ public class PSTextElementBridge extends
     }
 
 }
-

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSTextPainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSTextPainter.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSTextPainter.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSTextPainter.java Thu Apr  5 16:19:19 2012
@@ -292,10 +292,10 @@ public class PSTextPainter extends Nativ
 
         public boolean isFontChanging(Font f, char mapped) {
             if (f != getCurrentFont()) {
-                int encoding = mapped / 256;
-                if (encoding != getCurrentFontEncoding()) {
-                    return true; //Font is changing
-                }
+                return true;
+            }
+            if (mapped / 256 != getCurrentFontEncoding()) {
+                return true;
             }
             return false; //Font is the same
         }
@@ -443,7 +443,8 @@ public class PSTextPainter extends Nativ
                 if (multiByte) {
                     sb.append(HexEncoder.encode(mapped));
                 } else {
-                    PSGenerator.escapeChar(mapped, sb);
+                    char codepoint = (char) (mapped % 256);
+                    PSGenerator.escapeChar(codepoint, sb);
                 }
             }
             sb.append(multiByte ? '>' : ')');

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSTranscoder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSTranscoder.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSTranscoder.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/PSTranscoder.java Thu Apr  5 16:19:19 2012
@@ -23,7 +23,7 @@ import org.apache.xmlgraphics.java2d.ps.
 import org.apache.xmlgraphics.java2d.ps.PSDocumentGraphics2D;
 
 /**
- * This class enables to transcode an input to a PostScript document.
+ * <p>This class enables to transcode an input to a PostScript document.</p>
  *
  * <p>Two transcoding hints (<code>KEY_WIDTH</code> and
  * <code>KEY_HEIGHT</code>) can be used to respectively specify the image
@@ -46,8 +46,7 @@ import org.apache.xmlgraphics.java2d.ps.
  * stylesheet, and <code>KEY_PIXEL_TO_MM</code> to specify the pixel to
  * millimeter conversion factor.
  *
- * @author <a href="mailto:keiron@aftexsw.com">Keiron Liddle</a>
- * @version $Id$
+ * <p>This work was authored by Keiron Liddle (keiron@aftexsw.com).</p>
  */
 public class PSTranscoder extends AbstractPSTranscoder {
 

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionObject.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionObject.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionObject.java Thu Apr  5 16:19:19 2012
@@ -19,14 +19,14 @@
 
 package org.apache.fop.render.ps.extensions;
 
-// FOP
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.extensions.ExtensionAttachment;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
 
 /**
  * Base class for the PostScript-specific extension elements.

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java Thu Apr  5 16:19:19 2012
@@ -19,8 +19,8 @@
 
 package org.apache.fop.render.ps.extensions;
 
-import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.ElementMapping;
+import org.apache.fop.fo.FONode;
 
 /**
  * This class provides the element mapping for the PostScript-specific extensions.
@@ -38,7 +38,7 @@ public class PSExtensionElementMapping e
     /** {@inheritDoc} */
     protected void initialize() {
         if (foObjs == null) {
-            foObjs = new java.util.HashMap();
+            foObjs = new java.util.HashMap<String, Maker>();
             foObjs.put(PSSetupCodeElement.ELEMENT, new PSSetupCodeMaker());
             foObjs.put(PSPageSetupCodeElement.ELEMENT, new PSPageSetupCodeMaker());
             foObjs.put(PSSetPageDeviceElement.ELEMENT, new PSSetPageDeviceMaker());

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandlerFactory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandlerFactory.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandlerFactory.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandlerFactory.java Thu Apr  5 16:19:19 2012
@@ -19,9 +19,10 @@
 
 package org.apache.fop.render.ps.extensions;
 
-import org.apache.fop.util.ContentHandlerFactory;
 import org.xml.sax.ContentHandler;
 
+import org.apache.fop.util.ContentHandlerFactory;
+
 /**
  * Factory for the ContentHandler that handles serialized PSSetupCode instances.
  */

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/BorderAttributesConverter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/BorderAttributesConverter.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/BorderAttributesConverter.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/BorderAttributesConverter.java Thu Apr  5 16:19:19 2012
@@ -140,4 +140,4 @@ public final class BorderAttributesConve
        }
 
    }
-}
\ No newline at end of file
+}

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/FOPRtfAttributes.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/FOPRtfAttributes.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/FOPRtfAttributes.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/FOPRtfAttributes.java Thu Apr  5 16:19:19 2012
@@ -20,6 +20,7 @@
 package org.apache.fop.render.rtf;
 
 import java.awt.Color;
+
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.render.DummyPercentBaseContext;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes;

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/FoUnitsConverter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/FoUnitsConverter.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/FoUnitsConverter.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/FoUnitsConverter.java Thu Apr  5 16:19:19 2012
@@ -22,19 +22,16 @@ package org.apache.fop.render.rtf;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.xmlgraphics.util.UnitConv;
+
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.properties.FixedLength;
-import org.apache.xmlgraphics.util.UnitConv;
 
 
-/**  Converts XSL-FO units to RTF units
- *
- *  @author Bertrand Delacretaz <bdelacretaz@codeconsult.ch>
- *  @author putzi
- *  @author Peter Herweg <pherweg@web.de>
+/**
+ * <p>Converts XSL-FO units to RTF units.</p>
  *
- *  This class was originally developed by Bertrand Delacretaz bdelacretaz@codeconsult.ch
- *  for the JFOR project and is now integrated into FOP.
+ * <p>This work was originally developed by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).</p>
  */
 
 final class FoUnitsConverter {

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/ListAttributesConverter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/ListAttributesConverter.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/ListAttributesConverter.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/ListAttributesConverter.java Thu Apr  5 16:19:19 2012
@@ -70,4 +70,4 @@ public final class ListAttributesConvert
 
         return attrib;
     }
-}
\ No newline at end of file
+}

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java Thu Apr  5 16:19:19 2012
@@ -33,9 +33,11 @@ import org.apache.fop.render.rtf.rtflib.
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfPage;
 
 
-/**  Converts simple-page-master attributes into strings as defined in RtfPage.
- *  @author Christopher Scott, scottc@westinghouse.com
- *  @author Peter Herweg, pherweg@web.de
+/**
+ * <p>Converts simple-page-master attributes into strings as defined in RtfPage.</p>
+ *
+ * <p>This work was authored by Christopher Scott (scottc@westinghouse.com) and
+ * Peter Herweg (pherweg@web.de).</p>
  */
 
 final class PageAttributesConverter {

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/RTFHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/RTFHandler.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/RTFHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/RTFHandler.java Thu Apr  5 16:19:19 2012
@@ -32,7 +32,6 @@ import java.util.Iterator;
 import java.util.Map;
 
 import org.w3c.dom.Document;
-
 import org.xml.sax.SAXException;
 
 import org.apache.commons.io.IOUtils;
@@ -78,6 +77,7 @@ import org.apache.fop.fo.flow.ListItemBo
 import org.apache.fop.fo.flow.ListItemLabel;
 import org.apache.fop.fo.flow.PageNumber;
 import org.apache.fop.fo.flow.PageNumberCitation;
+import org.apache.fop.fo.flow.PageNumberCitationLast;
 import org.apache.fop.fo.flow.table.Table;
 import org.apache.fop.fo.flow.table.TableBody;
 import org.apache.fop.fo.flow.table.TableCell;
@@ -99,6 +99,7 @@ import org.apache.fop.layoutmgr.inline.I
 import org.apache.fop.layoutmgr.table.ColumnSetup;
 import org.apache.fop.render.DefaultFontResolver;
 import org.apache.fop.render.RendererEventProducer;
+import org.apache.fop.render.rtf.rtflib.exceptions.RtfException;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfAfterContainer;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfBeforeContainer;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.IRtfListContainer;
@@ -116,13 +117,13 @@ import org.apache.fop.render.rtf.rtflib.
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfHyperLink;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfList;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfListItem;
+import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfListItem.RtfListItemLabel;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfPage;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTable;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableCell;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTableRow;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTextrun;
-import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfListItem.RtfListItemLabel;
 import org.apache.fop.render.rtf.rtflib.tools.BuilderContext;
 import org.apache.fop.render.rtf.rtflib.tools.PercentContext;
 import org.apache.fop.render.rtf.rtflib.tools.TableContext;
@@ -130,12 +131,6 @@ import org.apache.fop.render.rtf.rtflib.
 /**
  * RTF Handler: generates RTF output using the structure events from
  * the FO Tree sent to this structure handler.
- *
- * @author Bertrand Delacretaz <bdelacretaz@codeconsult.ch>
- * @author Trembicki-Guy, Ed <GuyE@DNB.com>
- * @author Boris Poudérous <boris.pouderous@eads-telecom.com>
- * @author Peter Herweg <pherweg@web.de>
- * @author Andreas Putz <a.putz@skynamics.com>
  */
 public class RTFHandler extends FOEventHandler {
 
@@ -172,7 +167,8 @@ public class RTFHandler extends FOEventH
         this.os = os;
         bDefer = true;
 
-        FontSetup.setup(fontInfo, null, new DefaultFontResolver(userAgent));
+        boolean base14Kerning = false;
+        FontSetup.setup(fontInfo, null, new DefaultFontResolver(userAgent), base14Kerning);
     }
 
     /**
@@ -222,7 +218,7 @@ public class RTFHandler extends FOEventH
                     PageSequenceMaster master
                         = pageSeq.getRoot().getLayoutMasterSet().getPageSequenceMaster(reference);
                     this.pagemaster = master.getNextSimplePageMaster(
-                            false, false, false, false);
+                            false, false, false, false, pageSeq.getMainFlow().getFlowName());
                 }
             }
 
@@ -942,10 +938,10 @@ public class RTFHandler extends FOEventH
              */
             //TODO: do this only, if the labels content <> previous labels content
             if (list.getChildCount() > 0) {
-                this.endListBody();
+                this.endListBody(null);
                 this.endList((ListBlock) li.getParent());
                 this.startList((ListBlock) li.getParent());
-                this.startListBody();
+                this.startListBody(null);
 
                 list = (RtfList)builderContext.getContainer(
                         RtfList.class, true, this);
@@ -970,7 +966,7 @@ public class RTFHandler extends FOEventH
     }
 
     /** {@inheritDoc} */
-    public void startListLabel() {
+    public void startListLabel(ListItemLabel listItemLabel) {
         if (bDefer) {
             return;
         }
@@ -990,7 +986,7 @@ public class RTFHandler extends FOEventH
     }
 
     /** {@inheritDoc} */
-    public void endListLabel() {
+    public void endListLabel(ListItemLabel listItemLabel) {
         if (bDefer) {
             return;
         }
@@ -999,20 +995,20 @@ public class RTFHandler extends FOEventH
     }
 
     /** {@inheritDoc} */
-    public void startListBody() {
+    public void startListBody(ListItemBody listItemBody) {
     }
 
     /** {@inheritDoc} */
-    public void endListBody() {
+    public void endListBody(ListItemBody listItemBody) {
     }
 
     // Static Regions
     /** {@inheritDoc} */
-    public void startStatic() {
+    public void startStatic(StaticContent staticContent) {
     }
 
     /** {@inheritDoc} */
-    public void endStatic() {
+    public void endStatic(StaticContent statisContent) {
     }
 
     /** {@inheritDoc} */
@@ -1055,7 +1051,7 @@ public class RTFHandler extends FOEventH
     }
 
     /** {@inheritDoc} */
-    public void endLink() {
+    public void endLink(BasicLink basicLink) {
         if (bDefer) {
             return;
         }
@@ -1095,7 +1091,7 @@ public class RTFHandler extends FOEventH
     }
 
     /** {@inheritDoc} */
-    public void foreignObject(InstreamForeignObject ifo) {
+    public void endInstreamForeignObject(InstreamForeignObject ifo) {
         if (bDefer) {
             return;
         }
@@ -1342,7 +1338,7 @@ public class RTFHandler extends FOEventH
     }
 
     /** {@inheritDoc} */
-    public void leader(Leader l) {
+    public void startLeader(Leader l) {
         if (bDefer) {
             return;
         }
@@ -1358,8 +1354,10 @@ public class RTFHandler extends FOEventH
             RtfTextrun textrun = container.getTextrun();
 
             textrun.addLeader(rtfAttr);
-
-        } catch (Exception e) {
+        } catch (IOException e) {
+            log.error("startLeader: " + e.getMessage());
+            throw new RuntimeException(e.getMessage());
+        } catch (FOPException e) {
             log.error("startLeader: " + e.getMessage());
             throw new RuntimeException(e.getMessage());
         }
@@ -1367,11 +1365,9 @@ public class RTFHandler extends FOEventH
 
     /**
      * @param text FOText object
-     * @param data Array of characters to process.
-     * @param start Offset for characters to process.
-     * @param length Portion of array to process.
+     * @param characters CharSequence of the characters to process.
      */
-    public void text(FOText text, char[] data, int start, int length) {
+    public void text(FOText text, CharSequence characters) {
         if (bDefer) {
             return;
         }
@@ -1386,7 +1382,7 @@ public class RTFHandler extends FOEventH
                 = TextAttributesConverter.convertCharacterAttributes(text);
 
             textrun.pushInlineAttributes(rtfAttr);
-            textrun.addString(new String(data, start, length - start));
+            textrun.addString(characters.toString());
             textrun.popInlineAttributes();
         } catch (IOException ioe) {
             handleIOTrouble(ioe);
@@ -1448,6 +1444,29 @@ public class RTFHandler extends FOEventH
         }
     }
 
+    /** {@inheritDoc} */
+    public void startPageNumberCitationLast(PageNumberCitationLast l) {
+        if (bDefer) {
+            return;
+        }
+        try {
+
+            IRtfTextrunContainer container
+                  = (IRtfTextrunContainer)builderContext.getContainer(
+                      IRtfTextrunContainer.class, true, this);
+            RtfTextrun textrun = container.getTextrun();
+
+            textrun.addPageNumberCitation(l.getRefId());
+
+        } catch (RtfException e) {
+            log.error("startPageNumberCitationLast: " + e.getMessage());
+            throw new RuntimeException(e.getMessage());
+        } catch (IOException e) {
+            log.error("startPageNumberCitationLast: " + e.getMessage());
+            throw new RuntimeException(e.getMessage());
+        }
+    }
+
     private void prepareTable(Table tab) {
         // Allows to receive the available width of the table
         percentManager.setDimension(tab);
@@ -1500,9 +1519,9 @@ public class RTFHandler extends FOEventH
             }
         } else if (foNode instanceof StaticContent) {
             if (bStart) {
-                startStatic();
+                startStatic(null);
             } else {
-                endStatic();
+                endStatic(null);
             }
         } else if (foNode instanceof ExternalGraphic) {
             if (bStart) {
@@ -1510,7 +1529,7 @@ public class RTFHandler extends FOEventH
             }
         } else if (foNode instanceof InstreamForeignObject) {
             if (bStart) {
-                foreignObject( (InstreamForeignObject) foNode );
+                endInstreamForeignObject( (InstreamForeignObject) foNode );
             }
         } else if (foNode instanceof Block) {
             if (bStart) {
@@ -1529,7 +1548,7 @@ public class RTFHandler extends FOEventH
             if (bStart) {
                 startLink( (BasicLink) foNode);
             } else {
-                endLink();
+                endLink(null);
             }
         } else if (foNode instanceof Inline) {
             if (bStart) {
@@ -1540,7 +1559,7 @@ public class RTFHandler extends FOEventH
         } else if (foNode instanceof FOText) {
             if (bStart) {
                 FOText text = (FOText) foNode;
-                text(text, text.getCharArray(), 0, text.length());
+                text(text, text.getCharSequence());
             }
         } else if (foNode instanceof Character) {
             if (bStart) {
@@ -1573,9 +1592,9 @@ public class RTFHandler extends FOEventH
             }
         } else if (foNode instanceof ListItemBody) {
             if (bStart) {
-                startListBody();
+                startListBody(null);
             } else {
-                endListBody();
+                endListBody(null);
             }
         } else if (foNode instanceof ListItem) {
             if (bStart) {
@@ -1585,9 +1604,9 @@ public class RTFHandler extends FOEventH
             }
         } else if (foNode instanceof ListItemLabel) {
             if (bStart) {
-                startListLabel();
+                startListLabel(null);
             } else {
-                endListLabel();
+                endListLabel(null);
             }
         } else if (foNode instanceof Table) {
             if (bStart) {
@@ -1633,7 +1652,7 @@ public class RTFHandler extends FOEventH
             }
         } else if (foNode instanceof Leader) {
             if (bStart) {
-                leader((Leader) foNode);
+                startLeader((Leader) foNode);
             }
         } else if (foNode instanceof PageNumberCitation) {
             if (bStart) {
@@ -1641,6 +1660,12 @@ public class RTFHandler extends FOEventH
             } else {
                 endPageNumberCitation((PageNumberCitation) foNode);
             }
+        } else if (foNode instanceof PageNumberCitationLast) {
+            if (bStart) {
+                startPageNumberCitationLast((PageNumberCitationLast) foNode);
+            } else {
+                endPageNumberCitationLast((PageNumberCitationLast) foNode);
+            }
         } else {
             RTFEventProducer eventProducer = RTFEventProducer.Provider.get(
                     getUserAgent().getEventBroadcaster());

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java Thu Apr  5 16:19:19 2012
@@ -24,20 +24,21 @@ import java.awt.Color;
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.flow.table.Table;
-import org.apache.fop.fo.flow.table.TablePart;
 import org.apache.fop.fo.flow.table.TableCell;
 import org.apache.fop.fo.flow.table.TableHeader;
+import org.apache.fop.fo.flow.table.TablePart;
 import org.apache.fop.fo.flow.table.TableRow;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.ITableAttributes;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfAttributes;
 
 /**
- * Contributor(s):
- *  @author Roberto Marra <roberto@link-u.com>
- *  @author Boris Poudérous <boris.pouderous@eads-telecom.com>
- *  @author Normand Massé
- *  @author Peter Herweg <pherweg@web.de>
+ * <p>Table attributes converter.</p>
+ *
+ * <p>This work was authored by Roberto Marra (roberto@link-u.com),
+ * Boris Poudérous (boris.pouderous@eads-telecom.com),
+ * Normand Massé, and
+ * Peter Herweg (pherweg@web.de).</p>
  *
  * This class was originally developed for the JFOR project and
  * is now integrated into FOP.

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java Thu Apr  5 16:19:19 2012
@@ -48,14 +48,15 @@ import org.apache.fop.render.rtf.rtflib.
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfLeader;
 import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfText;
 
-/**  Converts FO properties to RtfAttributes
- *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
- *  @author Andreas Putz a.putz@skynamics.com
- *  @author Boris Poud&#x00E9;rous boris.pouderous@eads-telecom.com
- *  @author Peter Herweg, pherweg@web.de
- *  @author Normand Mass&#x00E9;
- *  @author Chris Scott
- *  @author rmarra
+/**
+ * <p>Converts FO properties to RtfAttributes.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch),
+ * Boris Poudérous (boris.pouderous@eads-telecom.com),
+ * Peter Herweg (pherweg@web.de),
+ * Normand Massé,
+ * Christopher Scott (scottc@westinghouse.com), and
+ * Roberto Marra (roberto@link-u.com).</p>
  */
 final class TextAttributesConverter {
 

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfException.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfException.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfException.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfException.java Thu Apr  5 16:19:19 2012
@@ -26,8 +26,10 @@ package org.apache.fop.render.rtf.rtflib
  * the FOP project.
  */
 
-/**  Base class for rtflib exceptions.
- *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
+/**
+ * <p>Base class for rtflib exceptions.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).</p>
  */
 public class RtfException extends java.io.IOException {
     /**
@@ -36,4 +38,4 @@ public class RtfException extends java.i
     public RtfException(String reason) {
         super(reason);
     }
-}
\ No newline at end of file
+}

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfStructureException.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfStructureException.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfStructureException.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfStructureException.java Thu Apr  5 16:19:19 2012
@@ -26,8 +26,10 @@ package org.apache.fop.render.rtf.rtflib
  * the FOP project.
  */
 
-/**  Thrown when a method call would lead to an invalid RTF document structure.
- *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
+/**
+ * <p>Thrown when a method call would lead to an invalid RTF document structure.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).</p>
  */
 public class RtfStructureException
 extends RtfException {
@@ -37,4 +39,4 @@ extends RtfException {
     public RtfStructureException(String reason) {
         super(reason);
     }
-}
\ No newline at end of file
+}

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfAfterContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfAfterContainer.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfAfterContainer.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfAfterContainer.java Thu Apr  5 16:19:19 2012
@@ -37,4 +37,4 @@ public interface IRtfAfterContainer {
      * @throws IOException for I/O problems
      */
     RtfAfter newAfter(RtfAttributes attrs) throws IOException;
-}
\ No newline at end of file
+}

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBeforeContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBeforeContainer.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBeforeContainer.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBeforeContainer.java Thu Apr  5 16:19:19 2012
@@ -40,4 +40,4 @@ public interface IRtfBeforeContainer {
      * @throws IOException for I/O problems
      */
     RtfBefore newBefore(RtfAttributes attrs) throws IOException;
-}
\ No newline at end of file
+}

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBookmarkContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBookmarkContainer.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBookmarkContainer.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBookmarkContainer.java Thu Apr  5 16:19:19 2012
@@ -29,8 +29,9 @@ package org.apache.fop.render.rtf.rtflib
 import java.io.IOException;
 
 /**
- * RTF Bookmark container interface.
- * @author <a href="mailto:a.putz@skynamics.com">Andreas Putz</a>
+ * <p>RTF Bookmark container interface.</p>
+ *
+ * <p>This work was authored by Andreas Putz (a.putz@skynamics.com).</p>
  */
 public interface IRtfBookmarkContainer {
 

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfHyperLinkContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfHyperLinkContainer.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfHyperLinkContainer.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfHyperLinkContainer.java Thu Apr  5 16:19:19 2012
@@ -28,8 +28,10 @@ package org.apache.fop.render.rtf.rtflib
 
 import java.io.IOException;
 
-/** interface for RtfElements that can contain RtfHyperLinks
- *  @author Andreas Putz a.putz@skynamics.com
+/**
+ * <p>Interface for RtfElements that can contain RtfHyperLinks.</p>
+ *
+ * <p>This work was authored by Andreas Putz (a.putz@skynamics.com).</p>
  */
 public interface IRtfHyperLinkContainer extends IRtfTextContainer {
     /**
@@ -40,4 +42,4 @@ public interface IRtfHyperLinkContainer 
      * @return new Hyperlink object
      */
     RtfHyperLink newHyperLink (String str, RtfAttributes attr) throws IOException;
-}
\ No newline at end of file
+}

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfJforCmdContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfJforCmdContainer.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfJforCmdContainer.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfJforCmdContainer.java Thu Apr  5 16:19:19 2012
@@ -39,4 +39,4 @@ public interface IRtfJforCmdContainer {
      * @throws IOException for I/O problems
      */
     RtfJforCmd newJforCmd(RtfAttributes attr) throws IOException;
-}
\ No newline at end of file
+}

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfListContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfListContainer.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfListContainer.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfListContainer.java Thu Apr  5 16:19:19 2012
@@ -28,8 +28,10 @@ package org.apache.fop.render.rtf.rtflib
 
 import java.io.IOException;
 
-/**  Interface for RtfElements that can contain RtfLists
- *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
+/**
+ * <p>Interface for RtfElements that can contain RtfLists.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).</p>
  */
 
 public interface IRtfListContainer {
@@ -39,4 +41,4 @@ public interface IRtfListContainer {
      * @throws IOException for I/O problems
      */
     RtfList newList(RtfAttributes attrs) throws IOException;
-}
\ No newline at end of file
+}

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfOptions.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfOptions.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfOptions.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfOptions.java Thu Apr  5 16:19:19 2012
@@ -41,4 +41,4 @@ public interface IRtfOptions {
      * @return Compression rate
      */
     int getRtfExternalGraphicCompressionRate ();
-}
\ No newline at end of file
+}

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageBreakContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageBreakContainer.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageBreakContainer.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageBreakContainer.java Thu Apr  5 16:19:19 2012
@@ -28,8 +28,10 @@ package org.apache.fop.render.rtf.rtflib
 
 import java.io.IOException;
 
-/**  Interface for RtfElements that can contain RtfPageBreaks
- *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
+/**
+ * <p>Interface for RtfElements that can contain RtfPageBreaks.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).</p>
  */
 
 public interface IRtfPageBreakContainer {
@@ -37,4 +39,4 @@ public interface IRtfPageBreakContainer 
      * @throws IOException for I/O problems
      */
     void newPageBreak() throws IOException;
-}
\ No newline at end of file
+}

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageContainer.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageContainer.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageContainer.java Thu Apr  5 16:19:19 2012
@@ -28,8 +28,10 @@ package org.apache.fop.render.rtf.rtflib
 
 import java.io.IOException;
 
-/**  Interface for RtfElements that can contain RtfText elements
- *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
+/**
+ * <p>Interface for RtfElements that can contain RtfText elements.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).</p>
  */
 
 public interface IRtfPageContainer {

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageNumberContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageNumberContainer.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageNumberContainer.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageNumberContainer.java Thu Apr  5 16:19:19 2012
@@ -39,4 +39,4 @@ public interface IRtfPageNumberContainer
      * @throws IOException for I/O problems.
      */
     RtfPageNumber newPageNumber() throws IOException;
-}
\ No newline at end of file
+}

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphContainer.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphContainer.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphContainer.java Thu Apr  5 16:19:19 2012
@@ -28,8 +28,10 @@ package org.apache.fop.render.rtf.rtflib
 
 import java.io.IOException;
 
-/**  Interface for RtfElements that can contain RtfParagraphs
- *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
+/**
+ * <p>Interface for RtfElements that can contain RtfParagraphs.</p>
+ *
+ * <p>This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).</p>
  */
 
 public interface IRtfParagraphContainer {
@@ -50,4 +52,4 @@ public interface IRtfParagraphContainer 
      */
     RtfParagraph newParagraph(RtfAttributes attr) throws IOException;
 
-}
\ No newline at end of file
+}

Modified: xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphKeepTogetherContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphKeepTogetherContainer.java?rev=1309921&r1=1309920&r2=1309921&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphKeepTogetherContainer.java (original)
+++ xmlgraphics/fop/branches/Temp_TrueTypeInPostScript/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphKeepTogetherContainer.java Thu Apr  5 16:19:19 2012
@@ -39,4 +39,4 @@ public interface IRtfParagraphKeepTogeth
      * @throws IOException for I/O problems
      */
     RtfParagraphKeepTogether newParagraphKeepTogether() throws IOException;
-}
\ No newline at end of file
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message