You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2008/07/17 16:24:54 UTC

svn commit: r677594 [1/2] - in /xmlgraphics/fop/branches/Temp_AreaTreeNewDesign: ./ src/codegen/java/org/apache/fop/tools/ src/java/org/apache/fop/apps/ src/java/org/apache/fop/cli/ src/java/org/apache/fop/events/ src/java/org/apache/fop/events/model/ ...

Author: jeremias
Date: Thu Jul 17 07:24:53 2008
New Revision: 677594

URL: http://svn.apache.org/viewvc?rev=677594&view=rev
Log:
Merge from Trunk up to revision 677588.
Switched from svnmerge to SVN 1.5 merge tracking manually for this branch only.

Modified:
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/   (props changed)
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/codegen/java/org/apache/fop/tools/EventProducerCollectorTask.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/apps/FOURIResolver.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/cli/CommandLineOptions.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/cli/InputHandler.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/cli/Main.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/events/EventFormatter.xml
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/events/model/EventMethodModel.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/events/model/EventModel.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/events/model/EventProducerModel.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/CustomFontCollection.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/FontManager.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/HyphenationTree.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/PatternParser.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/PrintRenderer.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/fonts/AFPFontReader.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/pcl/PCLRenderer.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/tools/TestConverter.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/tools/anttasks/Fop.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/tools/anttasks/RunTest.java
    xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/test/java/org/apache/fop/config/FontsSubstitutionTestCase.java

Propchange: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Thu Jul 17 07:24:53 2008
@@ -10,3 +10,4 @@
 dist-bin
 dist-src
 work
+.fbprefs

Propchange: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/
------------------------------------------------------------------------------
    svn:mergeinfo = /xmlgraphics/fop/trunk:603620-677588

Propchange: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/
------------------------------------------------------------------------------
    svnmerge-blocked = /xmlgraphics/fop/branches/fop-0_95:636406

Propchange: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jul 17 07:24:53 2008
@@ -1 +1 @@
-/xmlgraphics/fop/trunk:1-675627
+/xmlgraphics/fop/branches/fop-0_95:1-636405,636407-664698 /xmlgraphics/fop/trunk:1-611115

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/codegen/java/org/apache/fop/tools/EventProducerCollectorTask.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/codegen/java/org/apache/fop/tools/EventProducerCollectorTask.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/codegen/java/org/apache/fop/tools/EventProducerCollectorTask.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/codegen/java/org/apache/fop/tools/EventProducerCollectorTask.java Thu Jul 17 07:24:53 2008
@@ -22,6 +22,7 @@
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.io.OutputStream;
 import java.util.Iterator;
 import java.util.List;
 
@@ -38,6 +39,7 @@
 
 import org.w3c.dom.Node;
 
+import org.apache.commons.io.IOUtils;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.DirectoryScanner;
 import org.apache.tools.ant.Project;
@@ -56,13 +58,17 @@
     private List filesets = new java.util.ArrayList();
     private File modelFile;
     private File translationFile;
-    
+
     /** {@inheritDoc} */
     public void execute() throws BuildException {
         try {
             EventProducerCollector collector = new EventProducerCollector();
             processFileSets(collector);
-            getModelFile().getParentFile().mkdirs();
+            File parentDir = getModelFile().getParentFile();
+            if (!parentDir.exists() && !parentDir.mkdirs()) {
+                throw new BuildException(
+                        "Could not create target directory for event model file: " + parentDir);
+            }
             collector.saveModelToXML(getModelFile());
             log("Event model written to " + getModelFile());
             if (getTranslationFile() != null) {
@@ -76,10 +82,10 @@
             throw new BuildException(ioe);
         }
     }
-    
+
     private static final String MODEL2TRANSLATION = "model2translation.xsl";
     private static final String MERGETRANSLATION = "merge-translation.xsl";
-    
+
     /**
      * Updates the translation file with new entries for newly found event producer methods.
      * @throws IOException if an I/O error occurs
@@ -89,9 +95,9 @@
             boolean resultExists = getTranslationFile().exists();
             SAXTransformerFactory tFactory
                 = (SAXTransformerFactory)SAXTransformerFactory.newInstance();
-            
+
             //Generate fresh generated translation file as template
-            Source src = new StreamSource(getModelFile());
+            Source src = new StreamSource(getModelFile().toURI().toURL().toExternalForm());
             StreamSource xslt1 = new StreamSource(
                     getClass().getResourceAsStream(MODEL2TRANSLATION));
             if (xslt1.getInputStream() == null) {
@@ -101,11 +107,11 @@
             Transformer transformer = tFactory.newTransformer(xslt1);
             transformer.transform(src, domres);
             final Node generated = domres.getNode();
-            
+
             Node sourceDocument;
             if (resultExists) {
                 //Load existing translation file into memory (because we overwrite it later)
-                src = new StreamSource(getTranslationFile());
+                src = new StreamSource(getTranslationFile().toURI().toURL().toExternalForm());
                 domres = new DOMResult();
                 transformer = tFactory.newTransformer();
                 transformer.transform(src, domres);
@@ -117,29 +123,38 @@
 
             //Generate translation file (with potentially new translations)
             src = new DOMSource(sourceDocument);
-            Result res = new StreamResult(getTranslationFile());
-            StreamSource xslt2 = new StreamSource(
-                    getClass().getResourceAsStream(MERGETRANSLATION));
-            if (xslt2.getInputStream() == null) {
-                throw new FileNotFoundException(MERGETRANSLATION + " not found");
-            }
-            transformer = tFactory.newTransformer(xslt2);
-            transformer.setURIResolver(new URIResolver() {
-                public Source resolve(String href, String base) throws TransformerException {
-                    if ("my:dom".equals(href)) {
-                        return new DOMSource(generated);
+
+            //The following triggers a bug in older Xalan versions
+            //Result res = new StreamResult(getTranslationFile());
+            OutputStream out = new java.io.FileOutputStream(getTranslationFile());
+            out = new java.io.BufferedOutputStream(out);
+            Result res = new StreamResult(out);
+            try {
+                StreamSource xslt2 = new StreamSource(
+                        getClass().getResourceAsStream(MERGETRANSLATION));
+                if (xslt2.getInputStream() == null) {
+                    throw new FileNotFoundException(MERGETRANSLATION + " not found");
+                }
+                transformer = tFactory.newTransformer(xslt2);
+                transformer.setURIResolver(new URIResolver() {
+                    public Source resolve(String href, String base) throws TransformerException {
+                        if ("my:dom".equals(href)) {
+                            return new DOMSource(generated);
+                        }
+                        return null;
                     }
-                    return null;
+                });
+                if (resultExists) {
+                    transformer.setParameter("generated-url", "my:dom");
                 }
-            });
-            if (resultExists) {
-                transformer.setParameter("generated-url", "my:dom");
-            }
-            transformer.transform(src, res);
-            if (resultExists) {
-                log("Translation file updated: " + getTranslationFile());
-            } else {
-                log("Translation file generated: " + getTranslationFile());
+                transformer.transform(src, res);
+                if (resultExists) {
+                    log("Translation file updated: " + getTranslationFile());
+                } else {
+                    log("Translation file generated: " + getTranslationFile());
+                }
+            } finally {
+                IOUtils.closeQuietly(out);
             }
         } catch (TransformerException te) {
             throw new IOException(te.getMessage());
@@ -176,7 +191,7 @@
     public void addFileset(FileSet set) {
         filesets.add(set);
     }
-    
+
     /**
      * Sets the model file to be written.
      * @param f the model file
@@ -184,7 +199,7 @@
     public void setModelFile(File f) {
         this.modelFile = f;
     }
-    
+
     /**
      * Returns the model file to be written.
      * @return the model file
@@ -192,7 +207,7 @@
     public File getModelFile() {
         return this.modelFile;
     }
-    
+
     /**
      * Sets the translation file for the event producer methods.
      * @param f the translation file
@@ -200,7 +215,7 @@
     public void setTranslationFile(File f) {
         this.translationFile = f;
     }
-    
+
     /**
      * Returns the translation file for the event producer methods.
      * @return the translation file
@@ -208,7 +223,7 @@
     public File getTranslationFile() {
         return this.translationFile;
     }
-    
+
     /**
      * Command-line interface for testing purposes.
      * @param args the command-line arguments
@@ -222,15 +237,15 @@
             project.setName("Test");
             FileSet fileset = new FileSet();
             fileset.setDir(new File("test/java"));
-            
+
             FilenameSelector selector = new FilenameSelector();
             selector.setName("**/*.java");
             fileset.add(selector);
             generator.addFileset(fileset);
-            
+
             File targetDir = new File("build/codegen1");
             targetDir.mkdirs();
-            
+
             generator.setModelFile(new File("D:/out.xml"));
             generator.setTranslationFile(new File("D:/out1.xml"));
             generator.execute();

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/apps/FOURIResolver.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/apps/FOURIResolver.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/apps/FOURIResolver.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/apps/FOURIResolver.java Thu Jul 17 07:24:53 2008
@@ -77,7 +77,7 @@
         }
         File dir = new File(base);
         try {
-            base = (dir.isDirectory() ? dir.toURL() : new URL(base)).toExternalForm();
+            base = (dir.isDirectory() ? dir.toURI().toURL() : new URL(base)).toExternalForm();
         } catch (MalformedURLException mfue) {
             if (throwExceptions) {
                 throw mfue;
@@ -173,9 +173,9 @@
             if (file.canRead() && file.isFile()) {
                 try {
                     if (fragment != null) {
-                        absoluteURL = new URL(file.toURL().toExternalForm() + fragment);
+                        absoluteURL = new URL(file.toURI().toURL().toExternalForm() + fragment);
                     } else {
-                        absoluteURL = file.toURL();
+                        absoluteURL = file.toURI().toURL();
                     }
                 } catch (MalformedURLException mfue) {
                     handleException(mfue, "Could not convert filename '" + href

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/cli/CommandLineOptions.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/cli/CommandLineOptions.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/cli/CommandLineOptions.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/cli/CommandLineOptions.java Thu Jul 17 07:24:53 2008
@@ -60,7 +60,7 @@
     /** Used to indicate that only the result of the XSL transformation should be output */
     public static final int RENDER_NONE = -1;
 
-    /* These following constants are used to describe the input (either .FO, .XML/.XSL or 
+    /* These following constants are used to describe the input (either .FO, .XML/.XSL or
      * intermediate format)
      */
 
@@ -97,11 +97,15 @@
     private int inputmode = NOT_SET;
     /* output mode */
     private String outputmode = null;
+    /* true if System.in (stdin) should be used for the input file */
+    private boolean useStdIn = false;
+    /* true if System.out (stdout) should be used for the output file */
+    private boolean useStdOut = false;
     /* rendering options (for the user agent) */
     private Map renderingOptions = new java.util.HashMap();
     /* target resolution (for the user agent) */
     private int targetResolution = 0;
-    
+
     private FopFactory factory = FopFactory.newInstance();
     private FOUserAgent foUserAgent;
 
@@ -150,7 +154,7 @@
                 }
                 checkSettings();
                 setUserConfig();
-                
+
                 //Factory config is set up, now we can create the user agent
                 foUserAgent = factory.newFOUserAgent();
                 foUserAgent.getRendererOptions().putAll(renderingOptions);
@@ -382,7 +386,12 @@
                 || (args[i + 1].charAt(0) == '-')) {
             throw new FOPException("you must specify the fo file for the '-fo' option");
         } else {
-            fofile = new File(args[i + 1]);
+            String filename = args[i + 1];
+            if (isSystemInOutFile(filename)) {
+                this.useStdIn = true;
+            } else {
+                fofile = new File(filename);
+            }
             return 1;
         }
     }
@@ -406,7 +415,12 @@
             throw new FOPException("you must specify the input file "
                             + "for the '-xml' option");
         } else {
-            xmlfile = new File(args[i + 1]);
+            String filename = args[i + 1];
+            if (isSystemInOutFile(filename)) {
+                this.useStdIn = true;
+            } else {
+                xmlfile = new File(filename);
+            }
             return 1;
         }
     }
@@ -422,7 +436,7 @@
                 || (args[i + 1].charAt(0) == '-')) {
             throw new FOPException("you must specify the PDF output file");
         } else {
-            outfile = new File(args[i + 1]);
+            setOutputFile(args[i + 1]);
             if (pdfAMode != null) {
                 if (renderingOptions.get("pdf-a-mode") != null) {
                     throw new FOPException("PDF/A mode already set");
@@ -433,13 +447,25 @@
         }
     }
 
+    private void setOutputFile(String filename) {
+        if (isSystemInOutFile(filename)) {
+            this.useStdOut = true;
+        } else {
+            outfile = new File(filename);
+        }
+    }
+
+    private boolean isSystemInOutFile(String filename) {
+        return "#".equals(filename);
+    }
+
     private int parseMIFOutputOption(String[] args, int i) throws FOPException {
         setOutputMode(MimeConstants.MIME_MIF);
         if ((i + 1 == args.length)
                 || (args[i + 1].charAt(0) == '-')) {
             throw new FOPException("you must specify the MIF output file");
         } else {
-            outfile = new File(args[i + 1]);
+            setOutputFile(args[i + 1]);
             return 1;
         }
     }
@@ -450,7 +476,7 @@
                 || (args[i + 1].charAt(0) == '-')) {
             throw new FOPException("you must specify the RTF output file");
         } else {
-            outfile = new File(args[i + 1]);
+            setOutputFile(args[i + 1]);
             return 1;
         }
     }
@@ -461,7 +487,7 @@
                 || (args[i + 1].charAt(0) == '-')) {
             throw new FOPException("you must specify the TIFF output file");
         } else {
-            outfile = new File(args[i + 1]);
+            setOutputFile(args[i + 1]);
             return 1;
         }
     }
@@ -472,7 +498,7 @@
                 || (args[i + 1].charAt(0) == '-')) {
             throw new FOPException("you must specify the PNG output file");
         } else {
-            outfile = new File(args[i + 1]);
+            setOutputFile(args[i + 1]);
             return 1;
         }
     }
@@ -518,7 +544,7 @@
                 || (args[i + 1].charAt(0) == '-')) {
             throw new FOPException("you must specify the PDF output file");
         } else {
-            outfile = new File(args[i + 1]);
+            setOutputFile(args[i + 1]);
             return 1;
         }
     }
@@ -529,7 +555,7 @@
                 || (args[i + 1].charAt(0) == '-')) {
             throw new FOPException("you must specify the PostScript output file");
         } else {
-            outfile = new File(args[i + 1]);
+            setOutputFile(args[i + 1]);
             return 1;
         }
     }
@@ -540,7 +566,7 @@
                 || (args[i + 1].charAt(0) == '-')) {
             throw new FOPException("you must specify the text output file");
         } else {
-            outfile = new File(args[i + 1]);
+            setOutputFile(args[i + 1]);
             return 1;
         }
     }
@@ -551,7 +577,7 @@
                 || (args[i + 1].charAt(0) == '-')) {
             throw new FOPException("you must specify the SVG output file");
         } else {
-            outfile = new File(args[i + 1]);
+            setOutputFile(args[i + 1]);
             return 1;
         }
     }
@@ -562,7 +588,7 @@
                 || (args[i + 1].charAt(0) == '-')) {
             throw new FOPException("you must specify the AFP output file");
         } else {
-            outfile = new File(args[i + 1]);
+            setOutputFile(args[i + 1]);
             return 1;
         }
     }
@@ -573,7 +599,7 @@
                 || (args[i + 1].charAt(0) == '-')) {
             throw new FOPException("you must specify the FO output file");
         } else {
-            outfile = new File(args[i + 1]);
+            setOutputFile(args[i + 1]);
             return 1;
         }
     }
@@ -598,7 +624,7 @@
             throw new FOPException("you must specify the output format and the output file");
         } else {
             setOutputMode(mime);
-            outfile = new File(args[i + 2]);
+            setOutputFile(args[i + 2]);
             return 2;
         }
     }
@@ -609,7 +635,7 @@
             fofile = new File(args[i]);
         } else if (outputmode == null) {
             outputmode = MimeConstants.MIME_PDF;
-            outfile = new File(args[i]);
+            setOutputFile(args[i]);
         } else {
             throw new FOPException("Don't know what to do with "
                            + args[i]);
@@ -625,12 +651,12 @@
         } else if ((i + 2 == args.length)
                 || (args[i + 2].charAt(0) == '-')) {
             // only output file is specified
-            outfile = new File(args[i + 1]);
+            setOutputFile(args[i + 1]);
             return 1;
         } else {
             // mimic format and output file have been specified
             mimicRenderer = args[i + 1];
-            outfile = new File(args[i + 2]);
+            setOutputFile(args[i + 2]);
             return 2;
         }
     }
@@ -658,7 +684,12 @@
                 || (args[i + 1].charAt(0) == '-')) {
             throw new FOPException("you must specify the Area Tree file for the '-atin' option");
         } else {
-            areatreefile = new File(args[i + 1]);
+            String filename = args[i + 1];
+            if (isSystemInOutFile(filename)) {
+                this.useStdIn = true;
+            } else {
+                areatreefile = new File(filename);
+            }
             return 1;
         }
     }
@@ -669,14 +700,19 @@
                 || (args[i + 1].charAt(0) == '-')) {
             throw new FOPException("you must specify the image file for the '-imagein' option");
         } else {
-            imagefile = new File(args[i + 1]);
+            String filename = args[i + 1];
+            if (isSystemInOutFile(filename)) {
+                this.useStdIn = true;
+            } else {
+                imagefile = new File(filename);
+            }
             return 1;
         }
     }
 
     private PDFEncryptionParams getPDFEncryptionParams() throws FOPException {
         PDFEncryptionParams params = (PDFEncryptionParams)renderingOptions.get(
-                        PDFRenderer.ENCRYPTION_PARAMS); 
+                        PDFRenderer.ENCRYPTION_PARAMS);
         if (params == null) {
             if (!PDFEncryptionManager.checkAvailableAlgorithms()) {
                 throw new FOPException("PDF encryption requested but it is not available."
@@ -787,7 +823,7 @@
 
         if (inputmode == XSLT_INPUT) {
             // check whether xml *and* xslt file have been set
-            if (xmlfile == null) {
+            if (xmlfile == null && !this.useStdIn) {
                 throw new FOPException("XML file must be specified for the transform mode");
             }
             if (xsltfile == null) {
@@ -804,7 +840,7 @@
                                        + "\n  fofile: "
                                        + fofile.getAbsolutePath());
             }
-            if (!xmlfile.exists()) {
+            if (xmlfile != null && !xmlfile.exists()) {
                 throw new FileNotFoundException("Error: xml file "
                                                 + xmlfile.getAbsolutePath()
                                                 + " not found ");
@@ -822,10 +858,10 @@
             }
             if (xmlfile != null || xsltfile != null) {
                 log.warn("fo input mode, but xmlfile or xslt file are set:");
-                log.error("xml file: " + xmlfile.toString());
-                log.error("xslt file: " + xsltfile.toString());
+                log.error("xml file: " + xmlfile);
+                log.error("xslt file: " + xsltfile);
             }
-            if (!fofile.exists()) {
+            if (fofile != null && !fofile.exists()) {
                 throw new FileNotFoundException("Error: fo file "
                                                 + fofile.getAbsolutePath()
                                                 + " not found ");
@@ -840,10 +876,10 @@
             }
             if (xmlfile != null || xsltfile != null) {
                 log.warn("area tree input mode, but xmlfile or xslt file are set:");
-                log.error("xml file: " + xmlfile.toString());
-                log.error("xslt file: " + xsltfile.toString());
+                log.error("xml file: " + xmlfile);
+                log.error("xslt file: " + xsltfile);
             }
-            if (!areatreefile.exists()) {
+            if (areatreefile != null && !areatreefile.exists()) {
                 throw new FileNotFoundException("Error: area tree file "
                                               + areatreefile.getAbsolutePath()
                                               + " not found ");
@@ -857,7 +893,7 @@
                 log.warn("image input mode, but XML file is set:");
                 log.error("XML file: " + xmlfile.toString());
             }
-            if (!imagefile.exists()) {
+            if (imagefile != null && !imagefile.exists()) {
                 throw new FileNotFoundException("Error: image file "
                                               + imagefile.getAbsolutePath()
                                               + " not found ");
@@ -972,6 +1008,22 @@
     }
 
     /**
+     * Indicates whether input comes from standard input (stdin).
+     * @return true if input comes from standard input (stdin)
+     */
+    public boolean isInputFromStdIn() {
+        return this.useStdIn;
+    }
+
+    /**
+     * Indicates whether output is sent to standard output (stdout).
+     * @return true if output is sent to standard output (stdout)
+     */
+    public boolean isOutputToStdOut() {
+        return this.useStdOut;
+    }
+
+    /**
      * Returns the input file.
      * @return either the fofile or the xmlfile
      */
@@ -1013,15 +1065,17 @@
             + "                    (Examples for prof: PDF/A-1b or PDF/X-3:2003)\n\n"
             + " [INPUT]  \n"
             + "  infile            xsl:fo input file (the same as the next) \n"
+            + "                    (use # for infile to pipe input from stdin)\n"
             + "  -fo  infile       xsl:fo input file  \n"
             + "  -xml infile       xml input file, must be used together with -xsl \n"
             + "  -atin infile      area tree input file \n"
-            + "  -imagein infile   image input file \n"
+            + "  -imagein infile   image input file (piping through stdin not supported)\n"
             + "  -xsl stylesheet   xslt stylesheet \n \n"
             + "  -param name value <value> to use for parameter <name> in xslt stylesheet\n"
             + "                    (repeat '-param name value' for each parameter)\n \n"
             + " [OUTPUT] \n"
             + "  outfile           input will be rendered as PDF into outfile\n"
+            + "                    (use # for outfile to pipe output to stdout)\n"
             + "  -pdf outfile      input will be rendered as PDF (outfile req'd)\n"
             + "  -pdfa1b outfile   input will be rendered as PDF/A-1b compliant PDF\n"
             + "                    (outfile req'd, same as \"-pdf outfile -pdfprofile PDF/A-1b\")\n"
@@ -1055,6 +1109,7 @@
             + "  Fop -fo foo.fo -pdf foo.pdf (does the same as the previous line)\n"
             + "  Fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf\n"
             + "  Fop -xml foo.xml -xsl foo.xsl -foout foo.fo\n"
+            + "  Fop -xml # -xsl foo.xsl -pdf #\n"
             + "  Fop foo.fo -mif foo.mif\n"
             + "  Fop foo.fo -rtf foo.rtf\n"
             + "  Fop foo.fo -print\n"
@@ -1085,11 +1140,19 @@
             break;
         case FO_INPUT:
             log.info("FO ");
-            log.info("fo input file: " + fofile.toString());
+            if (this.useStdIn) {
+                log.info("fo input file: from stdin");
+            } else {
+                log.info("fo input file: " + fofile.toString());
+            }
             break;
         case XSLT_INPUT:
             log.info("xslt transformation");
-            log.info("xml input file: " + xmlfile.toString());
+            if (this.useStdIn) {
+                log.info("xml input file: from stdin");
+            } else {
+                log.info("xml input file: " + xmlfile.toString());
+            }
             log.info("xslt stylesheet: " + xsltfile.toString());
             break;
         default:
@@ -1102,7 +1165,7 @@
             log.info("awt on screen");
             if (outfile != null) {
                 log.error("awt mode, but outfile is set:");
-                log.info("out file: " + outfile.toString());
+                log.error("out file: " + outfile.toString());
             }
         } else if (MimeConstants.MIME_FOP_PRINT.equals(outputmode)) {
             log.info("print directly");
@@ -1115,13 +1178,21 @@
             if (mimicRenderer != null) {
               log.info("mimic renderer: " + mimicRenderer);
             }
-            log.info("output file: " + outfile.toString());
+            if (this.useStdOut) {
+                log.info("output file: to stdout");
+            } else {
+                log.info("output file: " + outfile.toString());
+            }
         } else if (MimeConstants.MIME_FOP_IF.equals(outputmode)) {
             log.info("intermediate format");
             log.info("output file: " + outfile.toString());
         } else {
             log.info(outputmode);
-            log.info("output file: " + outfile.toString());
+            if (this.useStdOut) {
+                log.info("output file: to stdout");
+            } else {
+                log.info("output file: " + outfile.toString());
+            }
         }
 
         log.info("OPTIONS");

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/cli/InputHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/cli/InputHandler.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/cli/InputHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/cli/InputHandler.java Thu Jul 17 07:24:53 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -21,8 +21,8 @@
 
 // Imported java.io classes
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.Vector;
 
@@ -58,7 +58,7 @@
  * parameters) or FO File input alone
  */
 public class InputHandler implements ErrorListener, Renderable {
-     
+
     /** original source file */
     protected File sourcefile = null;
     private File stylesheet = null;  // for XML/XSLT usage
@@ -66,12 +66,12 @@
 
     /** the logger */
     protected Log log = LogFactory.getLog(InputHandler.class);
-    
+
     /**
      * Constructor for XML->XSLT->FO input
      * @param xmlfile XML file
      * @param xsltfile XSLT file
-     * @param params Vector of command-line parameters (name, value, 
+     * @param params Vector of command-line parameters (name, value,
      *      name, value, ...) for XSL stylesheet, null if none
      */
     public InputHandler(File xmlfile, File xsltfile, Vector params) {
@@ -95,7 +95,7 @@
      * @param out the output stream to write the generated output to (may be null if not applicable)
      * @throws FOPException in case of an error during processing
      */
-    public void renderTo(FOUserAgent userAgent, String outputFormat, OutputStream out) 
+    public void renderTo(FOUserAgent userAgent, String outputFormat, OutputStream out)
                 throws FOPException {
 
         FopFactory factory = userAgent.getFactory();
@@ -107,12 +107,12 @@
         }
 
         // if base URL was not explicitly set in FOUserAgent, obtain here
-        if (fop.getUserAgent().getBaseURL() == null) {
+        if (fop.getUserAgent().getBaseURL() == null && sourcefile != null) {
             String baseURL = null;
 
             try {
                 baseURL = new File(sourcefile.getAbsolutePath()).
-                        getParentFile().toURL().toExternalForm();
+                        getParentFile().toURI().toURL().toExternalForm();
             } catch (Exception e) {
                 baseURL = "";
             }
@@ -124,7 +124,7 @@
 
         transformTo(res);
     }
-    
+
     /** {@inheritDoc} */
     public void renderTo(FOUserAgent userAgent, String outputFormat) throws FOPException {
         renderTo(userAgent, outputFormat, null);
@@ -140,34 +140,53 @@
         Result res = new StreamResult(out);
         transformTo(res);
     }
-    
+
     /**
      * Creates a Source for the main input file. Processes XInclude if
      * available in the XML parser.
-     * 
+     *
      * @return the Source for the main input file
      */
     protected Source createMainSource() {
         Source result;
+        InputStream in;
+        String uri;
+        if (this.sourcefile != null) {
+            try {
+                in = new java.io.FileInputStream(this.sourcefile);
+                uri = this.sourcefile.toURI().toASCIIString();
+            } catch (FileNotFoundException e) {
+                //handled elsewhere
+                return new StreamSource(this.sourcefile);
+            }
+        } else {
+            in = System.in;
+            uri = null;
+        }
         try {
-            InputSource is = new InputSource(new FileInputStream(
-                    this.sourcefile));
-            is.setSystemId(this.sourcefile.toURI().toASCIIString());
+            InputSource is = new InputSource(in);
+            is.setSystemId(uri);
             SAXParserFactory spf = SAXParserFactory.newInstance();
             spf.setFeature("http://xml.org/sax/features/namespaces", true);
             spf.setFeature("http://apache.org/xml/features/xinclude", true);
             XMLReader xr = spf.newSAXParser().getXMLReader();
             result = new SAXSource(xr, is);
         } catch (SAXException e) {
-            result = new StreamSource(this.sourcefile);
-        } catch (IOException e) {
-            result = new StreamSource(this.sourcefile);
+            if (this.sourcefile != null) {
+                result = new StreamSource(this.sourcefile);
+            } else {
+                result = new StreamSource(in, uri);
+            }
         } catch (ParserConfigurationException e) {
-            result = new StreamSource(this.sourcefile);
+            if (this.sourcefile != null) {
+                result = new StreamSource(this.sourcefile);
+            } else {
+                result = new StreamSource(in, uri);
+            }
         }
         return result;
     }
-    
+
     /**
      * Creates a Source for the selected stylesheet.
      * @return the Source for the selected stylesheet or null if there's no stylesheet
@@ -179,7 +198,7 @@
             return null;
         }
     }
-    
+
     /**
      * Transforms the input document to the input format expected by FOP using XSLT.
      * @param result the Result object where the result of the XSL transformation is sent to
@@ -190,15 +209,15 @@
             // Setup XSLT
             TransformerFactory factory = TransformerFactory.newInstance();
             Transformer transformer;
-            
+
             Source xsltSource = createXSLTSource();
             if (xsltSource == null) {   // FO Input
                 transformer = factory.newTransformer();
             } else {    // XML/XSLT input
                 transformer = factory.newTransformer(xsltSource);
-            
+
                 // Set the value of parameters, if any, defined for stylesheet
-                if (xsltParams != null) { 
+                if (xsltParams != null) {
                     for (int i = 0; i < xsltParams.size(); i += 2) {
                         transformer.setParameter((String) xsltParams.elementAt(i),
                             (String) xsltParams.elementAt(i + 1));

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/cli/Main.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/cli/Main.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/cli/Main.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/cli/Main.java Thu Jul 17 07:24:53 2008
@@ -62,11 +62,11 @@
             fopJar = new File(baseDir, "fop.jar");
         }
         if (!fopJar.exists()) {
-            throw new RuntimeException("fop.jar not found in directory: " 
+            throw new RuntimeException("fop.jar not found in directory: "
                     + baseDir.getAbsolutePath() + " (or below)");
         }
         List jars = new java.util.ArrayList();
-        jars.add(fopJar.toURL());
+        jars.add(fopJar.toURI().toURL());
         File[] files;
         FileFilter filter = new FileFilter() {
             public boolean accept(File pathname) {
@@ -80,7 +80,7 @@
         files = libDir.listFiles(filter);
         if (files != null) {
             for (int i = 0, size = files.length; i < size; i++) {
-                jars.add(files[i].toURL());
+                jars.add(files[i].toURI().toURL());
             }
         }
         String optionalLib = System.getProperty("fop.optional.lib");
@@ -88,7 +88,7 @@
             files = new File(optionalLib).listFiles(filter);
             if (files != null) {
                 for (int i = 0, size = files.length; i < size; i++) {
-                    jars.add(files[i].toURL());
+                    jars.add(files[i].toURI().toURL());
                 }
             }
         }
@@ -99,7 +99,7 @@
         }*/
         return urls;
     }
-    
+
     /**
      * @return true if FOP's dependecies are available in the current ClassLoader setup.
      */
@@ -115,7 +115,7 @@
             return false;
         }
     }
-    
+
     /**
      * Dynamically builds a ClassLoader and executes FOP.
      * @param args command-line arguments
@@ -123,7 +123,7 @@
     public static void startFOPWithDynamicClasspath(String[] args) {
         try {
             URL[] urls = getJARList();
-            //System.out.println("CCL: " 
+            //System.out.println("CCL: "
             //    + Thread.currentThread().getContextClassLoader().toString());
             ClassLoader loader = new java.net.URLClassLoader(urls, null);
             Thread.currentThread().setContextClassLoader(loader);
@@ -137,13 +137,13 @@
             System.exit(-1);
         }
     }
-    
+
     /**
      * Executes FOP with the given ClassLoader setup.
      * @param args command-line arguments
      */
     public static void startFOP(String[] args) {
-        //System.out.println("static CCL: " 
+        //System.out.println("static CCL: "
         //    + Thread.currentThread().getContextClassLoader().toString());
         //System.out.println("static CL: " + Fop.class.getClassLoader().toString());
         CommandLineOptions options = null;
@@ -155,7 +155,7 @@
             if (!options.parse(args)) {
                 System.exit(1);
             }
-            
+
             foUserAgent = options.getFOUserAgent();
             String outputFormat = options.getOutputFormat();
 
@@ -164,15 +164,17 @@
                     out = new java.io.BufferedOutputStream(
                             new java.io.FileOutputStream(options.getOutputFile()));
                     foUserAgent.setOutputFile(options.getOutputFile());
+                } else if (options.isOutputToStdOut()) {
+                    out = new java.io.BufferedOutputStream(System.out);
                 }
                 if (!MimeConstants.MIME_XSL_FO.equals(outputFormat)) {
                     options.getInputHandler().renderTo(foUserAgent, outputFormat, out);
                 } else {
                     options.getInputHandler().transformTo(out);
                 }
-             } finally {
-                 IOUtils.closeQuietly(out);
-             }
+            } finally {
+                IOUtils.closeQuietly(out);
+            }
 
             // System.exit(0) called to close AWT/SVG-created threads, if any.
             // AWTRenderer closes with window shutdown, so exit() should not
@@ -183,14 +185,14 @@
         } catch (Exception e) {
             if (options != null) {
                 options.getLogger().error("Exception", e);
-            }
-            if (options.getOutputFile() != null) {
-                options.getOutputFile().delete();
+                if (options.getOutputFile() != null) {
+                    options.getOutputFile().delete();
+                }
             }
             System.exit(1);
         }
     }
-    
+
     /**
      * The main routine for the command line interface
      * @param args the command line parameters

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/events/EventFormatter.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/events/EventFormatter.xml?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/events/EventFormatter.xml (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/events/EventFormatter.xml Thu Jul 17 07:24:53 2008
@@ -81,7 +81,7 @@
   <message key="org.apache.fop.layoutmgr.BlockLevelEventProducer.rowTooTall">The contents of table-row {row} are taller than they should be (there is a block-progression-dimension or height constraint on the indicated row). Due to its contents the row grows to {effCellBPD} millipoints, but the row shouldn't get any taller than {maxCellBPD} millipoints.{{locator}}</message>
   <message key="org.apache.fop.layoutmgr.BlockLevelEventProducer.tableFixedAutoWidthNotSupported">table-layout="fixed" and width="auto", but auto-layout not supported =&gt; assuming width="100%".{{locator}}</message>
   <message key="org.apache.fop.layoutmgr.BlockLevelEventProducer.objectTooWide">The extent in inline-progression-direction (width) of a {elementName} is bigger than the available space ({effIPD}mpt &gt; {maxIPD}mpt).{{locator}}</message>
-  <message key="org.apache.fop.layoutmgr.BlockLevelEventProducer.overconstrainedAdjustEndIndent">Adjusting end-indent based on overconstrained geometry rules for {elementName}.{{locator}}</message>
+  <message key="org.apache.fop.layoutmgr.BlockLevelEventProducer.overconstrainedAdjustEndIndent">An {elementName} {{locator}} is wider than the available room in inline-progression-dimension. Adjusting end-indent based on overconstrained geometry rules (XSL 1.1, ch. 5.3.4)</message>
   <message key="org.apache.fop.layoutmgr.BlockLevelEventProducer.viewportOverflow">Content overflows the viewport of an {elementName} in block-progression direction by {amount} millipoints.{clip,if, Content will be clipped.}{{locator}}</message>
   <message key="org.apache.fop.layoutmgr.BlockLevelEventProducer.regionOverflow">Content overflows the viewport of the {elementName} on page {page} in block-progression direction by {amount} millipoints.{clip,if, Content will be clipped.}{{locator}}</message>
   <message key="org.apache.fop.layoutmgr.BlockLevelEventProducer.flowNotMappingToRegionBody">Flow "{flowName}" does not map to the region-body in page-master "{masterName}". FOP presently does not support this.{{locator}}</message>

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/events/model/EventMethodModel.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/events/model/EventMethodModel.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/events/model/EventMethodModel.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/events/model/EventMethodModel.java Thu Jul 17 07:24:53 2008
@@ -37,12 +37,12 @@
 public class EventMethodModel implements Serializable, XMLizable {
 
     private static final long serialVersionUID = -7548882973341444354L;
-    
+
     private String methodName;
     private EventSeverity severity;
     private List params = new java.util.ArrayList();
     private String exceptionClass;
-    
+
     /**
      * Creates an new instance.
      * @param methodName the event method's name
@@ -52,7 +52,7 @@
         this.methodName = methodName;
         this.severity = severity;
     }
-    
+
     /**
      * Adds a method parameter.
      * @param param the method parameter
@@ -60,7 +60,7 @@
     public void addParameter(Parameter param) {
         this.params.add(param);
     }
-    
+
     /**
      * Adds a method parameter.
      * @param type the type of the parameter
@@ -68,11 +68,11 @@
      * @return the resulting Parameter instance
      */
     public Parameter addParameter(Class type, String name) {
-        Parameter param = new Parameter(type, name); 
+        Parameter param = new Parameter(type, name);
         addParameter(param);
         return param;
     }
-    
+
     /**
      * Sets the event method name.
      * @param name the event name
@@ -80,7 +80,7 @@
     public void setMethodName(String name) {
         this.methodName = name;
     }
-    
+
     /**
      * Returns the event method name
      * @return the event name
@@ -88,7 +88,7 @@
     public String getMethodName() {
         return this.methodName;
     }
-    
+
     /**
      * Sets the event's severity level.
      * @param severity the severity
@@ -96,7 +96,7 @@
     public void setSeverity(EventSeverity severity) {
         this.severity = severity;
     }
-    
+
     /**
      * Returns the event's severity level.
      * @return the severity
@@ -104,7 +104,7 @@
     public EventSeverity getSeverity() {
         return this.severity;
     }
-    
+
     /**
      * Returns an unmodifiable list of parameters for this event method.
      * @return the list of parameters
@@ -112,7 +112,7 @@
     public List getParameters() {
         return Collections.unmodifiableList(this.params);
     }
-    
+
     /**
      * Sets the primary exception class for this event method. Note: Not all event methods throw
      * exceptions!
@@ -121,7 +121,7 @@
     public void setExceptionClass(String exceptionClass) {
         this.exceptionClass = exceptionClass;
     }
-    
+
     /**
      * Returns the primary exception class for this event method. This method returns null if
      * the event is only informational or just a warning.
@@ -130,34 +130,34 @@
     public String getExceptionClass() {
         return this.exceptionClass;
     }
-    
+
     /** {@inheritDoc} */
     public void toSAX(ContentHandler handler) throws SAXException {
         AttributesImpl atts = new AttributesImpl();
-        atts.addAttribute(null, "name", "name", "CDATA", getMethodName());
-        atts.addAttribute(null, "severity", "severity", "CDATA", getSeverity().getName());
+        atts.addAttribute("", "name", "name", "CDATA", getMethodName());
+        atts.addAttribute("", "severity", "severity", "CDATA", getSeverity().getName());
         if (getExceptionClass() != null) {
-            atts.addAttribute(null, "exception", "exception", "CDATA", getExceptionClass());
+            atts.addAttribute("", "exception", "exception", "CDATA", getExceptionClass());
         }
         String elName = "method";
-        handler.startElement(null, elName, elName, atts);
+        handler.startElement("", elName, elName, atts);
         Iterator iter = this.params.iterator();
         while (iter.hasNext()) {
             ((XMLizable)iter.next()).toSAX(handler);
         }
-        handler.endElement(null, elName, elName);
+        handler.endElement("", elName, elName);
     }
-    
+
     /**
      * Represents an event parameter.
      */
     public static class Parameter implements Serializable, XMLizable {
-        
+
         private static final long serialVersionUID = 6062500277953887099L;
-        
+
         private Class type;
         private String name;
-        
+
         /**
          * Creates a new event parameter.
          * @param type the parameter type
@@ -167,7 +167,7 @@
             this.type = type;
             this.name = name;
         }
-        
+
         /**
          * Returns the parameter type.
          * @return the parameter type
@@ -175,7 +175,7 @@
         public Class getType() {
             return this.type;
         }
-        
+
         /**
          * Returns the parameter name.
          * @return the parameter name
@@ -187,12 +187,12 @@
         /** {@inheritDoc} */
         public void toSAX(ContentHandler handler) throws SAXException {
             AttributesImpl atts = new AttributesImpl();
-            atts.addAttribute(null, "type", "type", "CDATA", getType().getName());
-            atts.addAttribute(null, "name", "name", "CDATA", getName());
+            atts.addAttribute("", "type", "type", "CDATA", getType().getName());
+            atts.addAttribute("", "name", "name", "CDATA", getName());
             String elName = "parameter";
-            handler.startElement(null, elName, elName, atts);
-            handler.endElement(null, elName, elName);
+            handler.startElement("", elName, elName, atts);
+            handler.endElement("", elName, elName);
         }
-        
+
     }
 }

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/events/model/EventModel.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/events/model/EventModel.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/events/model/EventModel.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/events/model/EventModel.java Thu Jul 17 07:24:53 2008
@@ -21,6 +21,7 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.io.OutputStream;
 import java.io.Serializable;
 import java.util.Iterator;
 import java.util.Map;
@@ -38,6 +39,8 @@
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.AttributesImpl;
 
+import org.apache.commons.io.IOUtils;
+
 import org.apache.xmlgraphics.util.XMLizable;
 
 /**
@@ -46,15 +49,15 @@
 public class EventModel implements Serializable, XMLizable {
 
     private static final long serialVersionUID = 7468592614934605082L;
-    
+
     private Map producers = new java.util.LinkedHashMap();
-    
+
     /**
      * Creates a new, empty event model
      */
     public EventModel() {
     }
-    
+
     /**
      * Adds the model of an event producer to the event model.
      * @param producer the event producer model
@@ -62,7 +65,7 @@
     public void addProducer(EventProducerModel producer) {
         this.producers.put(producer.getInterfaceName(), producer);
     }
-    
+
     /**
      * Returns an iterator over the contained event producer models.
      * @return an iterator (Iterator&lt;EventProducerModel&gt;)
@@ -79,7 +82,7 @@
     public EventProducerModel getProducer(String interfaceName) {
         return (EventProducerModel)this.producers.get(interfaceName);
     }
-    
+
     /**
      * Returns the model of an event producer with the given interface.
      * @param clazz the interface of the event producer
@@ -88,22 +91,28 @@
     public EventProducerModel getProducer(Class clazz) {
         return getProducer(clazz.getName());
     }
-    
+
     /** {@inheritDoc} */
     public void toSAX(ContentHandler handler) throws SAXException {
         AttributesImpl atts = new AttributesImpl();
         String elName = "event-model";
-        handler.startElement(null, elName, elName, atts);
+        handler.startElement("", elName, elName, atts);
         Iterator iter = getProducers();
         while (iter.hasNext()) {
             ((XMLizable)iter.next()).toSAX(handler);
         }
-        handler.endElement(null, elName, elName);
+        handler.endElement("", elName, elName);
     }
 
     private void writeXMLizable(XMLizable object, File outputFile) throws IOException {
-        Result res = new StreamResult(outputFile);
-        
+        //These two approaches do not seem to work in all environments:
+        //Result res = new StreamResult(outputFile);
+        //Result res = new StreamResult(outputFile.toURI().toURL().toExternalForm());
+        //With an old Xalan version: file:/C:/.... --> file:\C:\.....
+        OutputStream out = new java.io.FileOutputStream(outputFile);
+        out = new java.io.BufferedOutputStream(out);
+        Result res = new StreamResult(out);
+
         try {
             SAXTransformerFactory tFactory
                 = (SAXTransformerFactory)SAXTransformerFactory.newInstance();
@@ -120,6 +129,8 @@
             throw new IOException(e.getMessage());
         } catch (SAXException e) {
             throw new IOException(e.getMessage());
+        } finally {
+            IOUtils.closeQuietly(out);
         }
     }
 

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/events/model/EventProducerModel.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/events/model/EventProducerModel.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/events/model/EventProducerModel.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/events/model/EventProducerModel.java Thu Jul 17 07:24:53 2008
@@ -35,18 +35,18 @@
 public class EventProducerModel implements Serializable, XMLizable {
 
     private static final long serialVersionUID = 122267104123721902L;
-    
+
     private String interfaceName;
     private Map methods = new java.util.LinkedHashMap();
-    
+
     /**
      * Creates a new instance.
-     * @param interfaceName the fully qualified interface name of the event producer 
+     * @param interfaceName the fully qualified interface name of the event producer
      */
     public EventProducerModel(String interfaceName) {
         this.interfaceName = interfaceName;
     }
-    
+
     /**
      * Returns the fully qualified interface name of the event producer.
      * @return the fully qualified interface name
@@ -54,7 +54,7 @@
     public String getInterfaceName() {
         return this.interfaceName;
     }
-    
+
     /**
      * Sets the fully qualified interface name of the event producer.
      * @param name the fully qualified interface name
@@ -62,7 +62,7 @@
     public void setInterfaceName(String name) {
         this.interfaceName = name;
     }
-    
+
     /**
      * Adds a model instance of an event method.
      * @param method the event method model
@@ -70,7 +70,7 @@
     public void addMethod(EventMethodModel method) {
         this.methods.put(method.getMethodName(), method);
     }
-    
+
     /**
      * Returns the model instance of an event method for the given method name.
      * @param methodName the method name
@@ -79,7 +79,7 @@
     public EventMethodModel getMethod(String methodName) {
         return (EventMethodModel)this.methods.get(methodName);
     }
-    
+
     /**
      * Returns an iterator over the contained event producer methods.
      * @return an iterator (Iterator&lt;EventMethodModel&gt;)
@@ -91,15 +91,15 @@
     /** {@inheritDoc} */
     public void toSAX(ContentHandler handler) throws SAXException {
         AttributesImpl atts = new AttributesImpl();
-        atts.addAttribute(null, "name", "name", "CDATA", getInterfaceName());
+        atts.addAttribute("", "name", "name", "CDATA", getInterfaceName());
         String elName = "producer";
-        handler.startElement(null, elName, elName, atts);
+        handler.startElement("", elName, elName, atts);
         Iterator iter = getMethods();
         while (iter.hasNext()) {
             ((XMLizable)iter.next()).toSAX(handler);
         }
-        handler.endElement(null, elName, elName);
+        handler.endElement("", elName, elName);
     }
 
-    
+
 }

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java Thu Jul 17 07:24:53 2008
@@ -92,7 +92,7 @@
 
         try {
             URL baseURL = new URL(getUserAgent().getBaseURL() == null 
-                            ? new java.io.File("").toURL().toExternalForm() 
+                            ? new java.io.File("").toURI().toURL().toExternalForm() 
                             : getUserAgent().getBaseURL());
             if (baseURL != null) {
                 SVGOMDocument svgdoc = (SVGOMDocument)doc; 

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/CustomFontCollection.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/CustomFontCollection.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/CustomFontCollection.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/CustomFontCollection.java Thu Jul 17 07:24:53 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -21,38 +21,35 @@
 
 import java.util.List;
 
-import org.apache.fop.render.PrintRenderer;
-
 /**
  * Sets up a set of custom (embedded) fonts
  */
 public class CustomFontCollection implements FontCollection {
 
-    private PrintRenderer renderer = null;
+    private FontResolver fontResolver;
+    private List/*<EmbedFontInfo>*/ embedFontInfoList;
 
     /**
-     * A print renderer to configure
-     * @param renderer a print renderer
+     * Main constructor.
+     * @param fontResolver a font resolver
+     * @param customFonts the list of custom fonts
      */
-    public CustomFontCollection(PrintRenderer renderer) {
-        this.renderer = renderer;
+    public CustomFontCollection(FontResolver fontResolver,
+            List/*<EmbedFontInfo>*/ customFonts) {
+        this.fontResolver = fontResolver;
+        if (this.fontResolver == null) {
+            //Ensure that we have minimal font resolution capabilities
+            this.fontResolver = FontManager.createMinimalFontResolver();
+        }
+        this.embedFontInfoList = customFonts;
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    /** {@inheritDoc} */
     public int setup(int num, FontInfo fontInfo) {
-        List/*<EmbedFontInfo>*/ embedFontInfoList = renderer.getFontList();
         if (embedFontInfoList == null) {
             return num; //No fonts to process
         }
 
-        FontResolver resolver = renderer.getFontResolver();
-        if (resolver == null) {
-            //Ensure that we have minimal font resolution capabilities
-            resolver = FontManager.createMinimalFontResolver();
-        }
-
         String internalName = null;
         //FontReader reader = null;
 
@@ -69,7 +66,7 @@
             fontInfo.addMetrics(internalName, reader.getFont());
             */
 
-            LazyFont font = new LazyFont(embedFontInfo, resolver);
+            LazyFont font = new LazyFont(embedFontInfo, this.fontResolver);
             fontInfo.addMetrics(internalName, font);
 
             List triplets = embedFontInfo.getFontTriplets();

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/FontManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/FontManager.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/FontManager.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/fonts/FontManager.java Thu Jul 17 07:24:53 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -19,7 +19,6 @@
 
 package org.apache.fop.fonts;
 
-import java.awt.Graphics2D;
 import java.net.MalformedURLException;
 
 import javax.xml.transform.Source;
@@ -27,7 +26,6 @@
 
 import org.apache.fop.fonts.FontTriplet.Matcher;
 import org.apache.fop.fonts.substitute.FontSubstitutions;
-import org.apache.fop.render.PrintRenderer;
 
 // TODO: Refactor fonts package so major font activities (autodetection etc)
 // are all centrally managed and delegated from this class, also remove dependency on FopFactory
@@ -144,55 +142,17 @@
     }
 
     /**
-     * Sets up the fonts on a given PrintRenderer
-     * @param renderer a print renderer
+     * Sets up the fonts on a given FontInfo object. The fonts to setup are defined by an
+     * array of {@code FontCollection} objects.
+     * @param fontInfo the FontInfo object to set up
+     * @param fontCollections the array of font collections/sources
      */
-    public void setupRenderer(PrintRenderer renderer) {
-        FontInfo fontInfo = renderer.getFontInfo();
-
+    public void setup(FontInfo fontInfo, FontCollection[] fontCollections) {
         int startNum = 1;
 
-        // Configure base 14 fonts
-        org.apache.fop.fonts.base14.Base14FontCollection base14FontCollection
-            = new org.apache.fop.fonts.base14.Base14FontCollection(this.enableBase14Kerning);
-        startNum = base14FontCollection.setup(startNum, fontInfo);
-
-        // Configure any custom font collection
-        org.apache.fop.fonts.CustomFontCollection customFontCollection
-            = new org.apache.fop.fonts.CustomFontCollection(renderer);
-        startNum = customFontCollection.setup(startNum, fontInfo);
-
-        // Make any defined substitutions in the font info
-        getFontSubstitutions().adjustFontInfo(fontInfo);
-    }
-
-    /**
-     * Sets up the fonts on a given PrintRenderer with Graphics2D
-     * @param renderer a print renderer
-     * @param graphics2D a graphics 2D
-     */
-    public void setupRenderer(PrintRenderer renderer, Graphics2D graphics2D) {
-        FontInfo fontInfo = renderer.getFontInfo();
-
-        int startNum = 1;
-
-        // setup base 14 fonts
-        org.apache.fop.render.java2d.Base14FontCollection base14FontCollection
-            = new org.apache.fop.render.java2d.Base14FontCollection(graphics2D);
-
-        // setup any custom font collection
-        startNum = base14FontCollection.setup(startNum, fontInfo);
-
-        // setup any installed fonts
-        org.apache.fop.render.java2d.InstalledFontCollection installedFontCollection
-            = new org.apache.fop.render.java2d.InstalledFontCollection(graphics2D);
-        startNum = installedFontCollection.setup(startNum, fontInfo);
-
-        // setup any configured fonts
-        org.apache.fop.render.java2d.ConfiguredFontCollection configuredFontCollection
-            = new org.apache.fop.render.java2d.ConfiguredFontCollection(renderer);
-        startNum = configuredFontCollection.setup(startNum, fontInfo);
-
+        for (int i = 0, c = fontCollections.length; i < c; i++) {
+            startNum = fontCollections[i].setup(startNum, fontInfo);
+        }
         // Make any defined substitutions in the font info
         getFontSubstitutions().adjustFontInfo(fontInfo);
     }

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/HyphenationTree.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/HyphenationTree.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/HyphenationTree.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/HyphenationTree.java Thu Jul 17 07:24:53 2008
@@ -125,7 +125,7 @@
     public void loadPatterns(String filename) throws HyphenationException {
         File f = new File(filename);
         try {
-            InputSource src = new InputSource(f.toURL().toExternalForm());
+            InputSource src = new InputSource(f.toURI().toURL().toExternalForm());
             loadPatterns(src);
         } catch (MalformedURLException e) {
             throw new HyphenationException("Error converting the File '" + f + "' to a URL: " 

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/PatternParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/PatternParser.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/PatternParser.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/hyphenation/PatternParser.java Thu Jul 17 07:24:53 2008
@@ -92,7 +92,7 @@
      */
     public void parse(File file) throws HyphenationException {
         try {
-            InputSource src = new InputSource(file.toURL().toExternalForm());
+            InputSource src = new InputSource(file.toURI().toURL().toExternalForm());
             parse(src);
         } catch (MalformedURLException e) {
             throw new HyphenationException("Error converting the File '" + file + "' to a URL: " 

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/PrintRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/PrintRenderer.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/PrintRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/PrintRenderer.java Thu Jul 17 07:24:53 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,19 +20,23 @@
 package org.apache.fop.render;
 
 // FOP
+import java.awt.Color;
+import java.awt.geom.Rectangle2D;
+import java.util.List;
+import java.util.Map;
+
+import org.w3c.dom.Document;
+
 import org.apache.fop.area.Area;
 import org.apache.fop.area.Trait;
+import org.apache.fop.fonts.CustomFontCollection;
 import org.apache.fop.fonts.Font;
+import org.apache.fop.fonts.FontCollection;
 import org.apache.fop.fonts.FontInfo;
+import org.apache.fop.fonts.FontManager;
 import org.apache.fop.fonts.FontResolver;
 import org.apache.fop.fonts.FontTriplet;
-import org.w3c.dom.Document;
-
-// Java
-import java.awt.Color;
-import java.awt.geom.Rectangle2D;
-import java.util.List;
-import java.util.Map;
+import org.apache.fop.fonts.base14.Base14FontCollection;
 
 /** Abstract base class of "Print" type renderers.  */
 public abstract class PrintRenderer extends AbstractRenderer {
@@ -79,7 +83,12 @@
      */
     public void setupFontInfo(FontInfo inFontInfo) {
         this.fontInfo = inFontInfo;
-        userAgent.getFactory().getFontManager().setupRenderer(this);
+        FontManager fontManager = userAgent.getFactory().getFontManager();
+        FontCollection[] fontCollections = new FontCollection[] {
+                new Base14FontCollection(fontManager.isBase14KerningEnabled()),
+                new CustomFontCollection(getFontResolver(), getFontList())
+        };
+        fontManager.setup(getFontInfo(), fontCollections);
     }
 
     /**

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/fonts/AFPFontReader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/fonts/AFPFontReader.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/fonts/AFPFontReader.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/afp/fonts/AFPFontReader.java Thu Jul 17 07:24:53 2008
@@ -157,7 +157,7 @@
             if (url == null) {
                 try {
                     File file = new File(path);
-                    url = file.toURL();
+                    url = file.toURI().toURL();
                     if (url == null) {
                         String msg = "CharacterSet file not found for "
                             + characterset + " in classpath: " + path;
@@ -194,7 +194,7 @@
                 log.warn(msg);
             }
 
-            inputStream = csfont[0].toURL().openStream();
+            inputStream = csfont[0].toURI().toURL().openStream();
             if (inputStream == null) {
                 String msg = "Failed to open character set resource "
                     + characterset;
@@ -258,7 +258,7 @@
         if (url == null) {
             try {
                 File file = new File(path);
-                url = file.toURL();
+                url = file.toURI().toURL();
                 if (url == null) {
                     String msg = "CodePage file not found for " + codePage
                         + " in classpath: " + path;
@@ -300,7 +300,7 @@
             log.warn(msg);
         }
 
-        InputStream is = codepage[0].toURL().openStream();
+        InputStream is = codepage[0].toURI().toURL().openStream();
 
         if (is == null) {
             String msg = "AFPFontReader:: loadCodePage(String):: code page file not found for "

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java Thu Jul 17 07:24:53 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -35,7 +35,6 @@
 import org.apache.fop.fonts.FontResolver;
 import org.apache.fop.fonts.FontTriplet;
 import org.apache.fop.fonts.LazyFont;
-import org.apache.fop.render.PrintRenderer;
 
 /**
  * A java2d configured font collection
@@ -44,37 +43,36 @@
 
     private static Log log = LogFactory.getLog(ConfiguredFontCollection.class);
 
-    private PrintRenderer renderer = null;
+    private FontResolver fontResolver;
+    private List/*<EmbedFontInfo>*/ embedFontInfoList;
 
     /**
      * Main constructor
-     * 
-     * @param renderer a print renderer
+     * @param fontResolver a font resolver
+     * @param customFonts the list of custom fonts
      */
-    public ConfiguredFontCollection(PrintRenderer renderer) {
-        this.renderer = renderer;
+    public ConfiguredFontCollection(FontResolver fontResolver,
+            List/*<EmbedFontInfo>*/ customFonts) {
+        this.fontResolver = fontResolver;
+        if (this.fontResolver == null) {
+            //Ensure that we have minimal font resolution capabilities
+            this.fontResolver = FontManager.createMinimalFontResolver();
+        }
+        this.embedFontInfoList = customFonts;
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    /** {@inheritDoc} */
     public int setup(int start, FontInfo fontInfo) {
-        List/*<EmbedFontInfo>*/ fontList = renderer.getFontList();
-        FontResolver resolver = renderer.getFontResolver();
         int num = start;
-        if (fontList == null || fontList.size() < 1) {
+        if (embedFontInfoList == null || embedFontInfoList.size() < 1) {
             log.debug("No user configured fonts found.");
             return num;
         }
-        if (resolver == null) {
-            // Ensure that we have minimal font resolution capabilities
-            resolver = FontManager.createMinimalFontResolver();
-        }
         String internalName = null;
 
-        for (int i = 0; i < fontList.size(); i++) {
+        for (int i = 0; i < embedFontInfoList.size(); i++) {
 
-            EmbedFontInfo configFontInfo = (EmbedFontInfo) fontList.get(i);
+            EmbedFontInfo configFontInfo = (EmbedFontInfo) embedFontInfoList.get(i);
             String fontFile = configFontInfo.getEmbedFile();
             internalName = "F" + num;
             num++;
@@ -84,11 +82,12 @@
                 // If the user specified an XML-based metrics file, we'll use it
                 // Otherwise, calculate metrics directly from the font file.
                 if (metricsUrl != null) {
-                    LazyFont fontMetrics = new LazyFont(configFontInfo, resolver);
-                    Source fontSource = resolver.resolve(configFontInfo.getEmbedFile());
+                    LazyFont fontMetrics = new LazyFont(configFontInfo, fontResolver);
+                    Source fontSource = fontResolver.resolve(configFontInfo.getEmbedFile());
                     font = new CustomFontMetricsMapper(fontMetrics, fontSource);
                 } else {
-                    CustomFont fontMetrics = FontLoader.loadFont(fontFile, null, true, resolver);
+                    CustomFont fontMetrics = FontLoader.loadFont(
+                            fontFile, null, true, fontResolver);
                     font = new CustomFontMetricsMapper(fontMetrics);
                 }
 

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/java2d/Java2DRenderer.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/java2d/Java2DRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/java2d/Java2DRenderer.java Thu Jul 17 07:24:53 2008
@@ -69,6 +69,7 @@
 import org.apache.fop.events.ResourceEventProducer;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fonts.Font;
+import org.apache.fop.fonts.FontCollection;
 import org.apache.fop.fonts.FontInfo;
 import org.apache.fop.fonts.Typeface;
 import org.apache.fop.render.AbstractPathOrientedRenderer;
@@ -176,7 +177,13 @@
         graphics2D.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
                 RenderingHints.VALUE_FRACTIONALMETRICS_ON);
 
-        userAgent.getFactory().getFontManager().setupRenderer(this, graphics2D);
+        FontCollection[] fontCollections = new FontCollection[] {
+                new Base14FontCollection(graphics2D),
+                new InstalledFontCollection(graphics2D),
+                new ConfiguredFontCollection(getFontResolver(), getFontList())
+        };
+        userAgent.getFactory().getFontManager().setup(
+                getFontInfo(), fontCollections);
     }
 
     /** {@inheritDoc} */

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/pcl/PCLRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/pcl/PCLRenderer.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/pcl/PCLRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/pcl/PCLRenderer.java Thu Jul 17 07:24:53 2008
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -82,6 +82,7 @@
 import org.apache.fop.events.ResourceEventProducer;
 import org.apache.fop.fo.extensions.ExtensionElementMapping;
 import org.apache.fop.fonts.Font;
+import org.apache.fop.fonts.FontCollection;
 import org.apache.fop.fonts.FontInfo;
 import org.apache.fop.fonts.FontMetrics;
 import org.apache.fop.render.Graphics2DAdapter;
@@ -89,7 +90,10 @@
 import org.apache.fop.render.RendererContext;
 import org.apache.fop.render.RendererContextConstants;
 import org.apache.fop.render.RendererEventProducer;
+import org.apache.fop.render.java2d.Base14FontCollection;
+import org.apache.fop.render.java2d.ConfiguredFontCollection;
 import org.apache.fop.render.java2d.FontMetricsMapper;
+import org.apache.fop.render.java2d.InstalledFontCollection;
 import org.apache.fop.render.java2d.Java2DRenderer;
 import org.apache.fop.render.pcl.extensions.PCLElementMapping;
 import org.apache.fop.traits.BorderProps;
@@ -207,7 +211,13 @@
         graphics2D.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
                 RenderingHints.VALUE_FRACTIONALMETRICS_ON);
 
-        userAgent.getFactory().getFontManager().setupRenderer(this, graphics2D);
+        FontCollection[] fontCollections = new FontCollection[] {
+                new Base14FontCollection(graphics2D),
+                new InstalledFontCollection(graphics2D),
+                new ConfiguredFontCollection(getFontResolver(), getFontList())
+        };
+        userAgent.getFactory().getFontManager().setup(
+                getFontInfo(), fontCollections);
     }
 
     /**
@@ -1035,7 +1045,7 @@
         //So there's some optimization potential but not otherwise PCLRenderer is a little
         //difficult to derive from AbstractPathOrientedRenderer. Maybe an additional layer
         //between PrintRenderer and AbstractPathOrientedRenderer is necessary.
-        
+
         // save position and offset
         int saveIP = currentIPPosition;
         int saveBP = currentBPPosition;
@@ -1045,7 +1055,7 @@
         at.translate(currentIPPosition, currentBPPosition);
         at.translate(block.getXOffset(), block.getYOffset());
         at.translate(0, block.getSpaceBefore());
-        
+
         if (!at.isIdentity()) {
             saveGraphicsState();
             concatenateTransformationMatrix(mptToPt(at));
@@ -1063,12 +1073,12 @@
         if (!at.isIdentity()) {
             restoreGraphicsState();
         }
-        
+
         // stacked and relative blocks effect stacking
         currentIPPosition = saveIP;
         currentBPPosition = saveBP;
     }
-    
+
     /** {@inheritDoc} */
     protected void renderFlow(NormalFlow flow) {
         //TODO This is the same code as in AbstractPathOrientedRenderer
@@ -1083,7 +1093,7 @@
         //Establish a new coordinate system
         AffineTransform at = new AffineTransform();
         at.translate(currentIPPosition, currentBPPosition);
-        
+
         if (!at.isIdentity()) {
             saveGraphicsState();
             concatenateTransformationMatrix(mptToPt(at));
@@ -1092,16 +1102,16 @@
         currentIPPosition = 0;
         currentBPPosition = 0;
         super.renderFlow(flow);
-        
+
         if (!at.isIdentity()) {
             restoreGraphicsState();
         }
-        
+
         // stacked and relative blocks effect stacking
         currentIPPosition = saveIP;
         currentBPPosition = saveBP;
     }
-    
+
     /**
      * Concatenates the current transformation matrix with the given one, therefore establishing
      * a new coordinate system.
@@ -1225,7 +1235,7 @@
         renderDocument(doc, ns, pos, fo.getForeignAttributes());
     }
 
-    /** 
+    /**
      * Common method to render the background and borders for any inline area.
      * The all borders and padding are drawn outside the specified area.
      * @param area the inline area for which the background, border and padding is to be

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/tools/TestConverter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/tools/TestConverter.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/tools/TestConverter.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/tools/TestConverter.java Thu Jul 17 07:24:53 2008
@@ -274,7 +274,7 @@
             File xmlFile = new File(baseDir + "/" + xml);
             String baseURL = null;
             try {
-                baseURL = xmlFile.getParentFile().toURL().toExternalForm();
+                baseURL = xmlFile.getParentFile().toURI().toURL().toExternalForm();
             } catch (Exception e) {
                 logger.error("Error setting base directory");
             }

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/tools/anttasks/Fop.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/tools/anttasks/Fop.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/tools/anttasks/Fop.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/tools/anttasks/Fop.java Thu Jul 17 07:24:53 2008
@@ -444,14 +444,14 @@
         //Set base directory
         if (task.getBasedir() != null) {
             try {
-                this.baseURL = task.getBasedir().toURL().toExternalForm();
+                this.baseURL = task.getBasedir().toURI().toURL().toExternalForm();
             } catch (MalformedURLException mfue) {
                 logger.error("Error creating base URL from base directory", mfue);
             }
         } else {
             try {
                 if (task.getFofile() != null) {
-                    this.baseURL =  task.getFofile().getParentFile().toURL().
+                    this.baseURL =  task.getFofile().getParentFile().toURI().toURL().
                                       toExternalForm();
                 }
             } catch (MalformedURLException mfue) {
@@ -519,11 +519,11 @@
 
                 try {
                     if (task.getRelativebase()) {
-                        this.baseURL = f.getParentFile().toURL().
+                        this.baseURL = f.getParentFile().toURI().toURL().
                                          toExternalForm();
                     }
                     if (this.baseURL == null) {
-                        this.baseURL = fs.getDir(task.getProject()).toURL().
+                        this.baseURL = fs.getDir(task.getProject()).toURI().toURL().
                                           toExternalForm();
                     }
 

Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/tools/anttasks/RunTest.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/tools/anttasks/RunTest.java?rev=677594&r1=677593&r2=677594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/tools/anttasks/RunTest.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/tools/anttasks/RunTest.java Thu Jul 17 07:24:53 2008
@@ -224,11 +224,11 @@
      */
     private URL[] createUrls(String mainJar) throws MalformedURLException {
         ArrayList urls = new ArrayList();
-        urls.add(new File(mainJar).toURL());
+        urls.add(new File(mainJar).toURI().toURL());
         File[] libFiles = new File("lib").listFiles();
         for (int i = 0; i < libFiles.length; i++) {
             if (libFiles[i].getPath().endsWith(".jar")) {
-                urls.add(libFiles[i].toURL());
+                urls.add(libFiles[i].toURI().toURL());
             }
         }
         return (URL[]) urls.toArray(new URL[urls.size()]);



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