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 me...@apache.org on 2012/06/26 14:31:58 UTC

svn commit: r1353992 [1/3] - in /xmlgraphics/fop/branches/Temp_URI_Unification: src/java/org/apache/fop/afp/util/ src/java/org/apache/fop/apps/io/ src/java/org/apache/fop/cli/ src/java/org/apache/fop/fonts/ src/java/org/apache/fop/fonts/autodetect/ src...

Author: mehdi
Date: Tue Jun 26 12:31:50 2012
New Revision: 1353992

URL: http://svn.apache.org/viewvc?rev=1353992&view=rev
Log:
Improved the handling of defaults for PDF config and general clean up

Added:
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java   (with props)
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/afp/AFPRendererOption.java   (with props)
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/BitmapRendererOption.java   (with props)
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pcl/Java2DRendererOption.java   (with props)
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFEncryptionOption.java   (with props)
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFRendererOption.java   (with props)
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFRendererOptionsConfig.java   (with props)
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/ps/PSRendererOption.java   (with props)
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/ps/fonts/
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/ps/fonts/PSTTFGenerator.java   (with props)
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/ps/fonts/PSTTFGlyphOutputStream.java   (with props)
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/ps/fonts/PSTTFOutputStream.java   (with props)
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/ps/fonts/PSTTFTableOutputStream.java   (with props)
    xmlgraphics/fop/branches/Temp_URI_Unification/test/java/org/apache/fop/render/pdf/PDFRendererOptionsConfigTestCase.java   (with props)
    xmlgraphics/fop/branches/Temp_URI_Unification/test/java/org/apache/fop/svg/
    xmlgraphics/fop/branches/Temp_URI_Unification/test/java/org/apache/fop/svg/PDFGraphics2DTestCase.java   (with props)
Removed:
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/afp/AFPRendererConfigOption.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/BitmapRendererConfigOption.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pcl/Java2DRendererConfigOption.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFRendererConfigOption.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/ps/PSRendererConfigurationOption.java
    xmlgraphics/fop/branches/Temp_URI_Unification/test/java/org/apache/fop/render/pdf/PDFRendererConfiguratorTestCase.java
Modified:
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/afp/util/AFPResourceUtil.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/apps/io/TempResourceResolver.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/apps/io/TempResourceURIGenerator.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/cli/CommandLineOptions.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/CustomFont.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/DefaultFontConfig.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/EmbedFontInfo.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/FontManager.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/FontReader.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/LazyFont.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/MultiByteFont.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/FontFileReader.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/TTFFile.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/pdf/PDFFactory.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/PrintRendererConfigurator.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/afp/AFPRendererConfig.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/BitmapRendererConfig.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/BitmapRenderingSettings.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/TIFFRendererConfig.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pcl/PCLRendererConfig.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFPainter.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFRendererConfig.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFRendererConfigurator.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFRenderingUtil.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/ps/PSRendererConfig.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/ps/PSRenderingUtil.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/ps/PSTextPainter.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/txt/TxtRendererConfig.java
    xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java
    xmlgraphics/fop/branches/Temp_URI_Unification/test/java/org/apache/fop/afp/AFPTestSuite.java
    xmlgraphics/fop/branches/Temp_URI_Unification/test/java/org/apache/fop/apps/AFPRendererConfBuilder.java
    xmlgraphics/fop/branches/Temp_URI_Unification/test/java/org/apache/fop/apps/BitmapRendererConfBuilder.java
    xmlgraphics/fop/branches/Temp_URI_Unification/test/java/org/apache/fop/apps/PDFRendererConfBuilder.java
    xmlgraphics/fop/branches/Temp_URI_Unification/test/java/org/apache/fop/apps/PSRendererConfBuilder.java
    xmlgraphics/fop/branches/Temp_URI_Unification/test/java/org/apache/fop/apps/TIFFRendererConfBuilder.java
    xmlgraphics/fop/branches/Temp_URI_Unification/test/java/org/apache/fop/apps/TxtRendererConfBuilder.java
    xmlgraphics/fop/branches/Temp_URI_Unification/test/java/org/apache/fop/render/bitmap/AbstractBitmapRendererConfigParserTester.java
    xmlgraphics/fop/branches/Temp_URI_Unification/test/java/org/apache/fop/render/bitmap/AbstractBitmapRendererConfiguratorTest.java
    xmlgraphics/fop/branches/Temp_URI_Unification/test/java/org/apache/fop/render/pcl/PCLRendererConfBuilder.java
    xmlgraphics/fop/branches/Temp_URI_Unification/test/java/org/apache/fop/render/pdf/PDFAConformanceTestCase.java
    xmlgraphics/fop/branches/Temp_URI_Unification/test/java/org/apache/fop/render/pdf/PDFRendererConfigParserTestCase.java
    xmlgraphics/fop/branches/Temp_URI_Unification/test/java/org/apache/fop/render/pdf/RenderPDFTestSuite.java
    xmlgraphics/fop/branches/Temp_URI_Unification/test/java/org/apache/fop/render/txt/TxtRendererConfigParserTestCase.java

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/afp/util/AFPResourceUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/afp/util/AFPResourceUtil.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/afp/util/AFPResourceUtil.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/afp/util/AFPResourceUtil.java Tue Jun 26 12:31:50 2012
@@ -92,13 +92,10 @@ public final class AFPResourceUtil {
             throws UnsupportedEncodingException {
         //The first 8 bytes of the field data represent the resource name
         byte[] nameBytes = new byte[8];
-
-        byte[] fieldData = field.getData();
-        if (fieldData.length < 8) {
-            throw new IllegalArgumentException("Field data does not contain a resource name");
-        }
-        System.arraycopy(fieldData, 0, nameBytes, 0, 8);
-        return new String(nameBytes, AFPConstants.EBCIDIC_ENCODING);
+        System.arraycopy(field.getData(), 0, nameBytes, 0, 8);
+        String asciiName;
+        asciiName = new String(nameBytes, AFPConstants.EBCIDIC_ENCODING);
+        return asciiName;
     }
 
     /**
@@ -131,13 +128,12 @@ public final class AFPResourceUtil {
     public static void copyNamedResource(String name,
             final InputStream in, final OutputStream out) throws IOException {
         final MODCAParser parser = new MODCAParser(in);
-        Collection<String> resourceNames = new java.util.HashSet<String>();
+        Collection resourceNames = new java.util.HashSet();
 
         //Find matching "Begin" field
         final UnparsedStructuredField fieldBegin;
         while (true) {
-            final UnparsedStructuredField field = parser.readNextStructuredField();
-
+            UnparsedStructuredField field = parser.readNextStructuredField();
             if (field == null) {
                 throw new IOException("Requested resource '" + name
                         + "' not found. Encountered resource names: " + resourceNames);
@@ -146,10 +142,8 @@ public final class AFPResourceUtil {
             if (field.getSfTypeCode() != TYPE_CODE_BEGIN) { //0xA8=Begin
                 continue; //Not a "Begin" field
             }
-            final String resourceName = getResourceName(field);
-
+            String resourceName = getResourceName(field);
             resourceNames.add(resourceName);
-
             if (resourceName.equals(name)) {
                 if (LOG.isDebugEnabled()) {
                     LOG.debug("Start of requested structured field found:\n"
@@ -176,35 +170,45 @@ public final class AFPResourceUtil {
         if (wrapInResource) {
             ResourceObject resourceObject =  new ResourceObject(name) {
                 protected void writeContent(OutputStream os) throws IOException {
-                    copyNamedStructuredFields(name, fieldBegin, parser, out);
+                    copyStructuredFields(name, fieldBegin, parser, out);
                 }
             };
             resourceObject.setType(ResourceObject.TYPE_PAGE_SEGMENT);
             resourceObject.writeToStream(out);
         } else {
-            copyNamedStructuredFields(name, fieldBegin, parser, out);
+            copyStructuredFields(name, fieldBegin, parser, out);
         }
     }
 
-    private static void copyNamedStructuredFields(final String name,
-            UnparsedStructuredField fieldBegin, MODCAParser parser,
-            OutputStream out) throws IOException {
-
-        UnparsedStructuredField field = fieldBegin;
-
-        while (true) {
+    private static void copyStructuredFields(String name, UnparsedStructuredField fieldBegin,
+            MODCAParser parser, OutputStream out) throws IOException {
+        boolean inRequestedResource;
+
+        //The "Begin" field first
+        out.write(MODCAParser.CARRIAGE_CONTROL_CHAR);
+        fieldBegin.writeTo(out);
+        UnparsedStructuredField field;
+
+        //Then the rest of the fields until the corresponding "End" field
+        inRequestedResource = true;
+        do {
+            field = parser.readNextStructuredField();
             if (field == null) {
-                throw new IOException("Ending structured field not found for resource " + name);
+                break; //Unexpected EOF
             }
-            out.write(MODCAParser.CARRIAGE_CONTROL_CHAR);
-            field.writeTo(out);
 
-            if (field.getSfTypeCode() == TYPE_CODE_END
-                    && fieldBegin.getSfCategoryCode() == field.getSfCategoryCode()
-                    && name.equals(getResourceName(field))) {
-                break;
+            if (field.getSfTypeCode() == TYPE_CODE_END) {
+                String resourceName = getResourceName(field);
+                if (resourceName.equals(name)) {
+                    inRequestedResource = false; //Signal end of loop
+                }
             }
-            field = parser.readNextStructuredField();
+            out.write(MODCAParser.CARRIAGE_CONTROL_CHAR);
+            field.writeTo(out);
+        } while (inRequestedResource);
+        if (inRequestedResource) {
+            throw new IOException("Ending structured field not found for resource " + name);
         }
     }
+
 }

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/apps/io/TempResourceResolver.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/apps/io/TempResourceResolver.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/apps/io/TempResourceResolver.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/apps/io/TempResourceResolver.java Tue Jun 26 12:31:50 2012
@@ -22,9 +22,27 @@ package org.apache.fop.apps.io;
 import java.io.IOException;
 import java.io.OutputStream;
 
+/**
+ * Implementations of this interface resolve URIs for temporary files used by FOP. The temporary-
+ * resource URI scheme comes from {@link TempResourceURIGenerator#TMP_SCHEMA}.
+ */
 public interface TempResourceResolver {
 
+    /**
+     * Get a temporary-resource given the URI pointing to said resource.
+     *
+     * @param uri the resource URI
+     * @return the resource
+     * @throws IOException if an I/O error occured during resource acquisition
+     */
     Resource getResource(String id) throws IOException;
 
+    /**
+     * Gets an temporary-output stream of a given URI.
+     *
+     * @param uri the output stream URI
+     * @return the output stream
+     * @throws IOException if an I/O error occured while creating an output stream
+     */
     OutputStream getOutputStream(String id) throws IOException;
 }

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/apps/io/TempResourceURIGenerator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/apps/io/TempResourceURIGenerator.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/apps/io/TempResourceURIGenerator.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/apps/io/TempResourceURIGenerator.java Tue Jun 26 12:31:50 2012
@@ -25,7 +25,7 @@ import java.util.concurrent.atomic.Atomi
  */
 public final class TempResourceURIGenerator {
 
-    private static final String TMP_SCHEMA = "tmp";
+    public static final String TMP_SCHEMA = "tmp";
 
     private final String tempURIPrefix;
 

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/cli/CommandLineOptions.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/cli/CommandLineOptions.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/cli/CommandLineOptions.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/cli/CommandLineOptions.java Tue Jun 26 12:31:50 2012
@@ -52,13 +52,12 @@ import org.apache.fop.render.awt.AWTRend
 import org.apache.fop.render.intermediate.IFContext;
 import org.apache.fop.render.intermediate.IFDocumentHandler;
 import org.apache.fop.render.intermediate.IFSerializer;
+import org.apache.fop.render.pdf.PDFEncryptionOption;
 import org.apache.fop.render.print.PagesMode;
 import org.apache.fop.render.print.PrintRenderer;
 import org.apache.fop.render.xml.XMLRenderer;
 import org.apache.fop.util.CommandLineLogger;
 
-import static org.apache.fop.render.pdf.PDFRendererConfigOption.ENCRYPTION_PARAMS;
-
 /**
  * Options parses the commandline arguments
  */
@@ -822,14 +821,14 @@ public class CommandLineOptions {
     }
 
     private PDFEncryptionParams getPDFEncryptionParams() throws FOPException {
-        PDFEncryptionParams params = (PDFEncryptionParams) renderingOptions.get(ENCRYPTION_PARAMS);
+        PDFEncryptionParams params = (PDFEncryptionParams) renderingOptions.get(PDFEncryptionOption.ENCRYPTION_PARAMS);
         if (params == null) {
             if (!PDFEncryptionManager.checkAvailableAlgorithms()) {
                 throw new FOPException("PDF encryption requested but it is not available."
                         + " Please make sure MD5 and RC4 algorithms are available.");
             }
             params = new PDFEncryptionParams();
-            renderingOptions.put(ENCRYPTION_PARAMS, params);
+            renderingOptions.put(PDFEncryptionOption.ENCRYPTION_PARAMS, params);
         }
         return params;
     }

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/CustomFont.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/CustomFont.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/CustomFont.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/CustomFont.java Tue Jun 26 12:31:50 2012
@@ -64,8 +64,6 @@ public abstract class CustomFont extends
 
     private boolean useKerning = true;
     private boolean useAdvanced = true;
-    /** the character map, mapping Unicode ranges to glyph indices. */
-    protected CMapSegment[] cmap;
 
     /**
      * @param resourceResolver the URI resource resolver for controlling file access
@@ -73,6 +71,8 @@ public abstract class CustomFont extends
     public CustomFont(InternalResourceResolver resourceResolver) {
         this.resourceResolver = resourceResolver;
     }
+    /** the character map, mapping Unicode ranges to glyph indices. */
+    protected CMapSegment[] cmap;
 
     /** {@inheritDoc} */
     public String getFontName() {
@@ -124,6 +124,7 @@ public abstract class CustomFont extends
     }
 
     /**
+
      * Returns the embedding mode for this font.
      * @return embedding mode
      */

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/DefaultFontConfig.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/DefaultFontConfig.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/DefaultFontConfig.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/DefaultFontConfig.java Tue Jun 26 12:31:50 2012
@@ -112,7 +112,7 @@ public final class DefaultFontConfig imp
                         fontCfg.getAttribute("sub-font", null), fontCfg.getAttributeAsBoolean(
                                 "kerning", true), fontCfg.getAttributeAsBoolean("advanced", true),
                         fontCfg.getAttribute("encoding-mode", EncodingMode.AUTO.getName()),
-                        fontCfg.getAttribute("embedding-mode", EmbeddingMode.AUTO.getName()));
+                        fontCfg.getAttribute("embedding-mode", EncodingMode.AUTO.getName()));
                 instance.fonts.add(font);
                 boolean hasTriplets = false;
                 for (Configuration tripletCfg : fontCfg.getChildren("font-triplet")) {
@@ -279,6 +279,10 @@ public final class DefaultFontConfig imp
 
         private final String embeddingMode;
 
+        public String getEncodingMode() {
+            return encodingMode;
+        }
+
         private final List<FontTriplet> tripletList = new ArrayList<FontTriplet>();
 
         public List<FontTriplet> getTripletList() {
@@ -332,10 +336,6 @@ public final class DefaultFontConfig imp
             return subFont;
         }
 
-        public String getEncodingMode() {
-            return encodingMode;
-        }
-
         public String getEmbeddingMode() {
             return embeddingMode;
         }

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/EmbedFontInfo.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/EmbedFontInfo.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/EmbedFontInfo.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/EmbedFontInfo.java Tue Jun 26 12:31:50 2012
@@ -42,6 +42,7 @@ public class EmbedFontInfo implements Se
     protected final boolean advanced;
     /** the requested encoding mode for the font */
     private final EncodingMode encodingMode;
+    /** the requested embedding mode for this font */
     private final EmbeddingMode embeddingMode;
 
     /** the PostScript name of the font */
@@ -63,7 +64,6 @@ public class EmbedFontInfo implements Se
      * @param embedURI Path to the embeddable font file (may be null)
      * @param subFontName the sub-fontname used for TrueType Collections (null otherwise)
      * @param encodingMode the encoding mode to use for this font
-     * @param embeddingMode the embedding mode for this font
      */
     public EmbedFontInfo(URI metricsURI, boolean kerning, boolean advanced,
             List<FontTriplet> fontTriplets, URI embedURI, String subFontName,

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/FontManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/FontManager.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/FontManager.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/FontManager.java Tue Jun 26 12:31:50 2012
@@ -233,6 +233,16 @@ public class FontManager {
         }
     }
 
+    /**
+     * Detect fonts from the operating system via FOPs autodetect mechanism.
+     *
+     * @param autoDetectFonts if autodetect has been enabled
+     * @param fontAdder the font adding mechanism
+     * @param strict whether to enforce strict validation
+     * @param listener the listener for font related events
+     * @param fontInfoList a list of font info objects
+     * @throws FOPException if an exception was thrown auto-detecting fonts
+     */
     public void autoDetectFonts(boolean autoDetectFonts, FontAdder fontAdder, boolean strict,
             FontEventListener  listener, List<EmbedFontInfo> fontInfoList) throws FOPException {
         if (autoDetectFonts) {

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/FontReader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/FontReader.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/FontReader.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/FontReader.java Tue Jun 26 12:31:50 2012
@@ -153,7 +153,6 @@ public class FontReader extends DefaultH
     /**
      * {@inheritDoc}
      */
-    @Override
     public void startElement(String uri, String localName, String qName, Attributes attributes)
             throws SAXException {
         if (localName.equals("font-metrics")) {

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/LazyFont.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/LazyFont.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/LazyFont.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/LazyFont.java Tue Jun 26 12:31:50 2012
@@ -46,9 +46,9 @@ public class LazyFont extends Typeface i
     private final boolean useKerning;
     private final boolean useAdvanced;
     private final EncodingMode encodingMode;
-    private final EmbeddingMode embeddingMode;
-    private final boolean embedded;
+    private EmbeddingMode embeddingMode;
     private final String subFontName;
+    private final boolean embedded;
     private final InternalResourceResolver resourceResolver;
 
     private boolean isMetricsLoaded;
@@ -70,8 +70,10 @@ public class LazyFont extends Typeface i
         } else {
             this.useAdvanced = fontInfo.getAdvanced();
         }
-        this.encodingMode = fontInfo.getEncodingMode();
-        this.embeddingMode = fontInfo.getEmbeddingMode();
+        this.encodingMode = fontInfo.getEncodingMode() != null ? fontInfo.getEncodingMode()
+                : EncodingMode.AUTO;
+        this.embeddingMode = fontInfo.getEmbeddingMode() != null ? fontInfo.getEmbeddingMode()
+                : EmbeddingMode.AUTO;
         this.subFontName = fontInfo.getSubFontName();
         this.embedded = fontInfo.isEmbedded();
         this.resourceResolver = resourceResolver;

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/MultiByteFont.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/MultiByteFont.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/MultiByteFont.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/MultiByteFont.java Tue Jun 26 12:31:50 2012
@@ -67,7 +67,7 @@ public class MultiByteFont extends CIDFo
     private int lastUnmapped;
 
     /**
-     * @param resourceResolver the resource resolver for accessing the font
+     * Default constructor
      */
     public MultiByteFont(InternalResourceResolver resourceResolver) {
         super(resourceResolver);

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java Tue Jun 26 12:31:50 2012
@@ -221,7 +221,8 @@ public class FontInfoFinder {
                 }
                 try {
                     TTFFontLoader ttfLoader = new TTFFontLoader(fontURI, fontName, true,
-                            EmbeddingMode.AUTO, EncodingMode.AUTO, useKerning, useAdvanced, resourceResolver);
+                            EmbeddingMode.AUTO, EncodingMode.AUTO, useKerning, useAdvanced,
+                            resourceResolver);
                     customFont = ttfLoader.getFont();
                     if (this.eventListener != null) {
                         customFont.setEventListener(this.eventListener);

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/FontFileReader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/FontFileReader.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/FontFileReader.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/FontFileReader.java Tue Jun 26 12:31:50 2012
@@ -124,9 +124,9 @@ public class FontFileReader {
         final byte buf = read();
 
         if (buf < 0) {
-            return (int)(256 + buf);
+            return (256 + buf);
         } else {
-            return (int)buf;
+            return buf;
         }
     }
 
@@ -150,7 +150,7 @@ public class FontFileReader {
      */
     public final int readTTFUShort() throws IOException {
         final int ret = (readTTFUByte() << 8) + readTTFUByte();
-        return (int)ret;
+        return ret;
     }
 
     /**

Added: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java?rev=1353992&view=auto
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java (added)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java Tue Jun 26 12:31:50 2012
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.fonts.truetype;
+
+/**
+ * The CMap entry contains information of a Unicode range and the
+ * the glyph indexes related to the range
+ */
+public class TTFCmapEntry {
+
+    private int unicodeStart;
+    private int unicodeEnd;
+    private int glyphStartIndex;
+
+    TTFCmapEntry() {
+        unicodeStart = 0;
+        unicodeEnd = 0;
+        glyphStartIndex = 0;
+    }
+
+    TTFCmapEntry(int unicodeStart, int unicodeEnd, int glyphStartIndex) {
+        this.unicodeStart = unicodeStart;
+        this.unicodeEnd = unicodeEnd;
+        this.glyphStartIndex = glyphStartIndex;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public int hashCode() {
+        int hc = super.hashCode();
+        hc ^= ( hc * 11 ) + unicodeStart;
+        hc ^= ( hc * 19 ) + unicodeEnd;
+        hc ^= ( hc * 23 ) + glyphStartIndex;
+        return hc;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean equals(Object o) {
+        if (o instanceof TTFCmapEntry) {
+            TTFCmapEntry ce = (TTFCmapEntry)o;
+            if (ce.unicodeStart == this.unicodeStart
+                    && ce.unicodeEnd == this.unicodeEnd
+                    && ce.glyphStartIndex == this.glyphStartIndex) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Returns the glyphStartIndex.
+     * @return int
+     */
+    public int getGlyphStartIndex() {
+        return glyphStartIndex;
+    }
+
+    /**
+     * Returns the unicodeEnd.
+     * @return int
+     */
+    public int getUnicodeEnd() {
+        return unicodeEnd;
+    }
+
+    /**
+     * Returns the unicodeStart.
+     * @return int
+     */
+    public int getUnicodeStart() {
+        return unicodeStart;
+    }
+
+    /**
+     * Sets the glyphStartIndex.
+     * @param glyphStartIndex The glyphStartIndex to set
+     */
+    public void setGlyphStartIndex(int glyphStartIndex) {
+        this.glyphStartIndex = glyphStartIndex;
+    }
+
+    /**
+     * Sets the unicodeEnd.
+     * @param unicodeEnd The unicodeEnd to set
+     */
+    public void setUnicodeEnd(int unicodeEnd) {
+        this.unicodeEnd = unicodeEnd;
+    }
+
+    /**
+     * Sets the unicodeStart.
+     * @param unicodeStart The unicodeStart to set
+     */
+    public void setUnicodeStart(int unicodeStart) {
+        this.unicodeStart = unicodeStart;
+    }
+
+}

Propchange: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/TTFFile.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/TTFFile.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/TTFFile.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/TTFFile.java Tue Jun 26 12:31:50 2012
@@ -2018,9 +2018,9 @@ public class TTFFile {
         try {
             boolean useKerning = true;
             boolean useAdvanced = true;
-            stream = new FileInputStream(args[0]);
             TTFFile ttfFile = new TTFFile(useKerning, useAdvanced);
 
+            stream = new FileInputStream(args[0]);
             FontFileReader reader = new FontFileReader(stream);
 
             String name = null;
@@ -2037,6 +2037,5 @@ public class TTFFile {
         } finally {
             IOUtils.closeQuietly(stream);
         }
-
     }
 }

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java Tue Jun 26 12:31:50 2012
@@ -72,10 +72,10 @@ public class TTFFontLoader extends FontL
      * @param useAdvanced true to enable loading advanced info if available, false to disable
      * @param resolver the FontResolver for font URI resolution
      */
-    public TTFFontLoader(URI fontFileURI, String subFontName,
-                boolean embedded, EmbeddingMode embeddingMode, EncodingMode encodingMode,
-            boolean useKerning, boolean useAdvanced, InternalResourceResolver resourceResolver) {
-        super(fontFileURI, embedded, useKerning, useAdvanced, resourceResolver);
+    public TTFFontLoader(URI fontFileURI, String subFontName, boolean embedded,
+            EmbeddingMode embeddingMode, EncodingMode encodingMode, boolean useKerning,
+            boolean useAdvanced, InternalResourceResolver resolver) {
+        super(fontFileURI, embedded, useKerning, useAdvanced, resolver);
         this.subFontName = subFontName;
         this.encodingMode = encodingMode;
         this.embeddingMode = embeddingMode;

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java Tue Jun 26 12:31:50 2012
@@ -29,6 +29,8 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.commons.io.IOUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import org.apache.fop.apps.io.InternalResourceResolver;
 import org.apache.fop.fonts.CodePointMapping;
@@ -42,6 +44,8 @@ import org.apache.fop.fonts.SingleByteFo
  */
 public class Type1FontLoader extends FontLoader {
 
+    private static final Log log = LogFactory.getLog(Type1FontLoader.class);
+
     private SingleByteFont singleFont;
 
     /**

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/pdf/PDFFactory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/pdf/PDFFactory.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/pdf/PDFFactory.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/pdf/PDFFactory.java Tue Jun 26 12:31:50 2012
@@ -40,6 +40,7 @@ import org.apache.commons.logging.LogFac
 
 import org.apache.xmlgraphics.java2d.color.ColorUtil;
 import org.apache.xmlgraphics.java2d.color.NamedColorSpace;
+
 import org.apache.xmlgraphics.xmp.Metadata;
 
 import org.apache.fop.fonts.CIDFont;

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/PrintRendererConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/PrintRendererConfigurator.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/PrintRendererConfigurator.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/PrintRendererConfigurator.java Tue Jun 26 12:31:50 2012
@@ -74,14 +74,35 @@ public abstract class PrintRendererConfi
         this.fontInfoConfigurator = fontInfoConfigurator;
     }
 
+    /**
+     * Returns the renderer configuration data for a specific renderer.
+     *
+     * @param documentHandler the document handler
+     * @return the renderer configuration data
+     * @throws FOPException if an error occurs
+     */
     protected RendererConfig getRendererConfig(IFDocumentHandler documentHandler) throws FOPException {
-        return  getRendererConfig(documentHandler.getMimeType());
+        return getRendererConfig(documentHandler.getMimeType());
     }
 
+    /**
+     * gets the renderer configuration data for a specific renderer.
+     *
+     * @param mimeType the MIME type
+     * @return the renderer configuration data
+     * @throws FOPException if an error occurs
+     */
     protected RendererConfig getRendererConfig(String mimeType) throws FOPException {
         return userAgent.getRendererConfig(mimeType, rendererConfigParser);
     }
 
+    /**
+     * gets the renderer configuration data for a specific renderer.
+     *
+     * @param renderer the renderer
+     * @return the renderer configuration data
+     * @throws FOPException if an error occurs
+     */
     protected RendererConfig getRendererConfig(Renderer renderer) throws FOPException {
         return  getRendererConfig(renderer.getMimeType());
     }
@@ -114,6 +135,14 @@ public abstract class PrintRendererConfi
 
     protected abstract List<FontCollection> getDefaultFontCollection();
 
+    /**
+     * Returns the font collection for custom configured fonts.
+     *
+     * @param resolver the resource resolver
+     * @param mimeType the renderer MIME type
+     * @return the font collection
+     * @throws FOPException if an error occurs
+     */
     protected FontCollection getCustomFontCollection(InternalResourceResolver resolver, String mimeType)
             throws FOPException {
         List<EmbedFontInfo> fontList;
@@ -125,6 +154,13 @@ public abstract class PrintRendererConfi
         return createCollectionFromFontList(resolver, fontList);
     }
 
+    /***
+     * Creates the font collection given a list of embedded font infomation.
+     *
+     * @param resolver the resource resolver
+     * @param fontList the embedded font infomation
+     * @return the font collection
+     */
     protected FontCollection createCollectionFromFontList(InternalResourceResolver resolver,
             List<EmbedFontInfo> fontList) {
         return new CustomFontCollection(resolver, fontList,

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/afp/AFPRendererConfig.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/afp/AFPRendererConfig.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/afp/AFPRendererConfig.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/afp/AFPRendererConfig.java Tue Jun 26 12:31:50 2012
@@ -45,23 +45,23 @@ import org.apache.fop.util.LogUtil;
 
 import static org.apache.fop.render.afp.AFPRendererConfig.ImagesModeOptions.MODE_COLOR;
 import static org.apache.fop.render.afp.AFPRendererConfig.ImagesModeOptions.MODE_GRAYSCALE;
-import static org.apache.fop.render.afp.AFPRendererConfigOption.DEFAULT_RESOURCE_LEVELS;
-import static org.apache.fop.render.afp.AFPRendererConfigOption.GOCA;
-import static org.apache.fop.render.afp.AFPRendererConfigOption.GOCA_TEXT;
-import static org.apache.fop.render.afp.AFPRendererConfigOption.IMAGES;
-import static org.apache.fop.render.afp.AFPRendererConfigOption.IMAGES_DITHERING_QUALITY;
-import static org.apache.fop.render.afp.AFPRendererConfigOption.IMAGES_FS45;
-import static org.apache.fop.render.afp.AFPRendererConfigOption.IMAGES_JPEG;
-import static org.apache.fop.render.afp.AFPRendererConfigOption.IMAGES_MAPPING_OPTION;
-import static org.apache.fop.render.afp.AFPRendererConfigOption.IMAGES_MODE;
-import static org.apache.fop.render.afp.AFPRendererConfigOption.IMAGES_NATIVE;
-import static org.apache.fop.render.afp.AFPRendererConfigOption.IMAGES_WRAP_PSEG;
-import static org.apache.fop.render.afp.AFPRendererConfigOption.JPEG_ALLOW_JPEG_EMBEDDING;
-import static org.apache.fop.render.afp.AFPRendererConfigOption.JPEG_BITMAP_ENCODING_QUALITY;
-import static org.apache.fop.render.afp.AFPRendererConfigOption.LINE_WIDTH_CORRECTION;
-import static org.apache.fop.render.afp.AFPRendererConfigOption.RENDERER_RESOLUTION;
-import static org.apache.fop.render.afp.AFPRendererConfigOption.RESOURCE_GROUP_URI;
-import static org.apache.fop.render.afp.AFPRendererConfigOption.SHADING;
+import static org.apache.fop.render.afp.AFPRendererOption.DEFAULT_RESOURCE_LEVELS;
+import static org.apache.fop.render.afp.AFPRendererOption.GOCA;
+import static org.apache.fop.render.afp.AFPRendererOption.GOCA_TEXT;
+import static org.apache.fop.render.afp.AFPRendererOption.IMAGES;
+import static org.apache.fop.render.afp.AFPRendererOption.IMAGES_DITHERING_QUALITY;
+import static org.apache.fop.render.afp.AFPRendererOption.IMAGES_FS45;
+import static org.apache.fop.render.afp.AFPRendererOption.IMAGES_JPEG;
+import static org.apache.fop.render.afp.AFPRendererOption.IMAGES_MAPPING_OPTION;
+import static org.apache.fop.render.afp.AFPRendererOption.IMAGES_MODE;
+import static org.apache.fop.render.afp.AFPRendererOption.IMAGES_NATIVE;
+import static org.apache.fop.render.afp.AFPRendererOption.IMAGES_WRAP_PSEG;
+import static org.apache.fop.render.afp.AFPRendererOption.JPEG_ALLOW_JPEG_EMBEDDING;
+import static org.apache.fop.render.afp.AFPRendererOption.JPEG_BITMAP_ENCODING_QUALITY;
+import static org.apache.fop.render.afp.AFPRendererOption.LINE_WIDTH_CORRECTION;
+import static org.apache.fop.render.afp.AFPRendererOption.RENDERER_RESOLUTION;
+import static org.apache.fop.render.afp.AFPRendererOption.RESOURCE_GROUP_URI;
+import static org.apache.fop.render.afp.AFPRendererOption.SHADING;
 
 /**
  * The AFP renderer config object.
@@ -103,7 +103,7 @@ public final class AFPRendererConfig imp
         }
     }
 
-    private final EnumMap<AFPRendererConfigOption, Object> params = new EnumMap<AFPRendererConfigOption, Object>(AFPRendererConfigOption.class);
+    private final EnumMap<AFPRendererOption, Object> params = new EnumMap<AFPRendererOption, Object>(AFPRendererOption.class);
 
     private final EnumMap<ImagesModeOptions, Object> imageModeParams
     = new EnumMap<ImagesModeOptions, Object>(ImagesModeOptions.class);
@@ -189,12 +189,12 @@ public final class AFPRendererConfig imp
         return getParam(GOCA_TEXT, Boolean.class);
     }
 
-    private <T> T getParam(AFPRendererConfigOption options, Class<T> type) {
+    private <T> T getParam(AFPRendererOption options, Class<T> type) {
         assert options.getType().equals(type);
         return type.cast(params.get(options));
     }
 
-    private <T> void setParam(AFPRendererConfigOption option, T value) {
+    private <T> void setParam(AFPRendererOption option, T value) {
         assert option.getType().isInstance(value);
         params.put(option, value);
     }
@@ -272,7 +272,7 @@ public final class AFPRendererConfig imp
             createResourceLevel();
         }
 
-        private void setParam(AFPRendererConfigOption option, Object value) {
+        private void setParam(AFPRendererOption option, Object value) {
             config.setParam(option, value);
         }
 
@@ -289,7 +289,7 @@ public final class AFPRendererConfig imp
                 config.imageModeParams.put(MODE_GRAYSCALE,
                         imagesCfg.getAttributeAsInteger(imagesMode.getModeAttribute(), 8));
             }
-            String dithering = imagesCfg.getAttribute(AFPRendererConfigOption.IMAGES_DITHERING_QUALITY.getName(), "medium");
+            String dithering = imagesCfg.getAttribute(AFPRendererOption.IMAGES_DITHERING_QUALITY.getName(), "medium");
             float dq;
             if (dithering.startsWith("min")) {
                 dq = 0.0f;

Added: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/afp/AFPRendererOption.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/afp/AFPRendererOption.java?rev=1353992&view=auto
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/afp/AFPRendererOption.java (added)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/afp/AFPRendererOption.java Tue Jun 26 12:31:50 2012
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.fop.render.afp;
+
+import java.net.URI;
+
+import org.apache.fop.afp.AFPResourceLevelDefaults;
+import org.apache.fop.render.RendererConfigOption;
+
+/**
+ * An enumeration of the configuration options available for the AFP renderer.
+ */
+public enum AFPRendererOption implements RendererConfigOption {
+    DEFAULT_RESOURCE_LEVELS("default-resource-levels", AFPResourceLevelDefaults.class),
+    IMAGES("images", null),
+    IMAGES_JPEG("jpeg", null),
+    IMAGES_DITHERING_QUALITY("dithering-quality", Float.class),
+    IMAGES_FS45("fs45", Boolean.class),
+    IMAGES_MAPPING_OPTION("mapping_option", Byte.class),
+    IMAGES_MODE("mode", Boolean.class),
+    IMAGES_NATIVE("native", Boolean.class),
+    IMAGES_WRAP_PSEG("pseg", Boolean.class),
+    JPEG_ALLOW_JPEG_EMBEDDING("allow-embedding", Boolean.class),
+    JPEG_BITMAP_ENCODING_QUALITY("bitmap-encoding-quality", Float.class),
+    RENDERER_RESOLUTION("renderer-resolution", Integer.class),
+    RESOURCE_GROUP_URI("resource-group-file", URI.class),
+    SHADING("shading", AFPShadingMode.class),
+    LINE_WIDTH_CORRECTION("line-width-correction", Float.class),
+    GOCA("goca", Boolean.class),
+    GOCA_TEXT("text", Boolean.class);
+
+    private final String name;
+
+    private final Class<?> type;
+
+    private AFPRendererOption(String name, Class<?> type) {
+        this.name = name;
+        this.type = type;
+    }
+
+    /** {@inheritDoc}}*/
+    public String getName() {
+        return name;
+    }
+
+    public Class<?> getType() {
+        return type;
+    }
+}

Propchange: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/afp/AFPRendererOption.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/BitmapRendererConfig.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/BitmapRendererConfig.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/BitmapRendererConfig.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/BitmapRendererConfig.java Tue Jun 26 12:31:50 2012
@@ -34,21 +34,21 @@ import org.apache.fop.render.java2d.Java
 import org.apache.fop.render.java2d.Java2DRendererConfig.Java2DRendererConfigParser;
 import org.apache.fop.util.ColorUtil;
 
-import static org.apache.fop.render.bitmap.BitmapRendererConfigOption.ANTI_ALIASING;
-import static org.apache.fop.render.bitmap.BitmapRendererConfigOption.BACKGROUND_COLOR;
-import static org.apache.fop.render.bitmap.BitmapRendererConfigOption.COLOR_MODE;
-import static org.apache.fop.render.bitmap.BitmapRendererConfigOption.JAVA2D_TRANSPARENT_PAGE_BACKGROUND;
-import static org.apache.fop.render.bitmap.BitmapRendererConfigOption.RENDERING_QUALITY;
-import static org.apache.fop.render.bitmap.BitmapRendererConfigOption.RENDERING_QUALITY_ELEMENT;
-import static org.apache.fop.render.bitmap.BitmapRendererConfigOption.RENDERING_SPEED;
+import static org.apache.fop.render.bitmap.BitmapRendererOption.ANTI_ALIASING;
+import static org.apache.fop.render.bitmap.BitmapRendererOption.BACKGROUND_COLOR;
+import static org.apache.fop.render.bitmap.BitmapRendererOption.COLOR_MODE;
+import static org.apache.fop.render.bitmap.BitmapRendererOption.JAVA2D_TRANSPARENT_PAGE_BACKGROUND;
+import static org.apache.fop.render.bitmap.BitmapRendererOption.RENDERING_QUALITY;
+import static org.apache.fop.render.bitmap.BitmapRendererOption.RENDERING_QUALITY_ELEMENT;
+import static org.apache.fop.render.bitmap.BitmapRendererOption.RENDERING_SPEED;
 
 /**
  * The Bitmap renderer config data object.
  */
 public class BitmapRendererConfig implements RendererConfig {
 
-    private final EnumMap<BitmapRendererConfigOption, Object> params
-            = new EnumMap<BitmapRendererConfigOption, Object>(BitmapRendererConfigOption.class);
+    private final EnumMap<BitmapRendererOption, Object> params
+            = new EnumMap<BitmapRendererOption, Object>(BitmapRendererOption.class);
 
     private final DefaultFontConfig fontConfig;
 
@@ -82,7 +82,7 @@ public class BitmapRendererConfig implem
                 : JAVA2D_TRANSPARENT_PAGE_BACKGROUND.getDefaultValue());
     }
 
-    private Object get(BitmapRendererConfigOption option) {
+    private Object get(BitmapRendererOption option) {
         return params.get(option);
     }
 
@@ -97,7 +97,7 @@ public class BitmapRendererConfig implem
             this.mimeType = mimeType;
         }
 
-        private void setParam(BitmapRendererConfig config, BitmapRendererConfigOption option,
+        private void setParam(BitmapRendererConfig config, BitmapRendererOption option,
                 Object value) {
             config.params.put(option, value != null ? value : option.getDefaultValue());
         }
@@ -122,17 +122,17 @@ public class BitmapRendererConfig implem
                             ColorUtil.parseColorString(userAgent, background));
                 }
 
-                setParam(config, BitmapRendererConfigOption.ANTI_ALIASING,
+                setParam(config, BitmapRendererOption.ANTI_ALIASING,
                         getChild(cfg, ANTI_ALIASING).getValueAsBoolean(
                                 (Boolean) ANTI_ALIASING.getDefaultValue()));
 
                 String optimization = getValue(cfg, RENDERING_QUALITY_ELEMENT);
                 setParam(config, RENDERING_QUALITY,
-                        !(BitmapRendererConfigOption.getValue(optimization) == RENDERING_SPEED));
+                        !(BitmapRendererOption.getValue(optimization) == RENDERING_SPEED));
 
                 String color = getValue(cfg, COLOR_MODE);
                 setParam(config, COLOR_MODE,
-                        getBufferedImageIntegerFromColor(BitmapRendererConfigOption.getValue(color)));
+                        getBufferedImageIntegerFromColor(BitmapRendererOption.getValue(color)));
             }
         }
 
@@ -144,7 +144,7 @@ public class BitmapRendererConfig implem
             return config;
         }
 
-        private Integer getBufferedImageIntegerFromColor(BitmapRendererConfigOption option) {
+        private Integer getBufferedImageIntegerFromColor(BitmapRendererOption option) {
             if (option == null) {
                 return null;
             }
@@ -163,11 +163,11 @@ public class BitmapRendererConfig implem
             }
         }
 
-        private Configuration getChild(Configuration cfg, BitmapRendererConfigOption option) {
+        private Configuration getChild(Configuration cfg, BitmapRendererOption option) {
             return cfg.getChild(option.getName());
         }
 
-        private String getValue(Configuration cfg, BitmapRendererConfigOption option) {
+        private String getValue(Configuration cfg, BitmapRendererOption option) {
             return cfg.getChild(option.getName()).getValue(null);
         }
 

Added: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/BitmapRendererOption.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/BitmapRendererOption.java?rev=1353992&view=auto
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/BitmapRendererOption.java (added)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/BitmapRendererOption.java Tue Jun 26 12:31:50 2012
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.render.bitmap;
+
+import java.awt.Color;
+import java.awt.image.BufferedImage;
+
+import org.apache.fop.render.RendererConfigOption;
+
+/**
+ * An enumeration of the Bitmap renderer configuration opetions available to the user via the FOP
+ * conf.
+ */
+public enum BitmapRendererOption implements RendererConfigOption {
+    JAVA2D_TRANSPARENT_PAGE_BACKGROUND("transparent-page-background", false),
+    BACKGROUND_COLOR("background-color", Color.WHITE),
+    ANTI_ALIASING("anti-aliasing", true),
+    RENDERING_QUALITY_ELEMENT("rendering"),
+    RENDERING_QUALITY("quality", true),
+    RENDERING_SPEED("speed"),
+    COLOR_MODE("color-mode", BufferedImage.TYPE_INT_ARGB),
+    COLOR_MODE_RGBA("rgba"),
+    COLOR_MODE_RGB("rgb"),
+    COLOR_MODE_GRAY("gray"),
+    COLOR_MODE_BINARY("binary"),
+    COLOR_MODE_BILEVEL("bi-level");
+
+    private final String name;
+    private final Object defaultValue;
+
+    private BitmapRendererOption(String name, Object defaultValue) {
+        this.name = name;
+        this.defaultValue = defaultValue;
+    }
+
+    private BitmapRendererOption(String name) {
+        this(name, null);
+    }
+
+    /** {@inheritDoc} */
+    public String getName() {
+        return name;
+    }
+
+    public Object getDefaultValue() {
+        return defaultValue;
+    }
+
+    public static BitmapRendererOption getValue(String str) {
+        for (BitmapRendererOption opt : BitmapRendererOption.values()) {
+            if (opt.getName().equalsIgnoreCase(str)) {
+                return opt;
+            }
+        }
+        return null;
+    }
+}

Propchange: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/BitmapRendererOption.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/BitmapRenderingSettings.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/BitmapRenderingSettings.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/BitmapRenderingSettings.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/BitmapRenderingSettings.java Tue Jun 26 12:31:50 2012
@@ -23,9 +23,9 @@ import org.apache.xmlgraphics.image.writ
 
 import org.apache.fop.render.java2d.Java2DRenderingSettings;
 
-import static org.apache.fop.render.bitmap.BitmapRendererConfigOption.ANTI_ALIASING;
-import static org.apache.fop.render.bitmap.BitmapRendererConfigOption.COLOR_MODE;
-import static org.apache.fop.render.bitmap.BitmapRendererConfigOption.RENDERING_QUALITY;
+import static org.apache.fop.render.bitmap.BitmapRendererOption.ANTI_ALIASING;
+import static org.apache.fop.render.bitmap.BitmapRendererOption.COLOR_MODE;
+import static org.apache.fop.render.bitmap.BitmapRendererOption.RENDERING_QUALITY;
 
 /**
  * This class holds settings used when rendering to bitmaps.

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java Tue Jun 26 12:31:50 2012
@@ -31,7 +31,6 @@ import org.apache.fop.render.intermediat
  */
 public class TIFFDocumentHandler extends AbstractBitmapDocumentHandler {
 
-
     TIFFDocumentHandler(IFContext context) {
         super(context);
     }
@@ -51,5 +50,4 @@ public class TIFFDocumentHandler extends
     public IFDocumentHandlerConfigurator getConfigurator() {
         return new TIFFRendererConfigurator(getUserAgent(), new TIFFRendererConfigParser());
     }
-
 }

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/TIFFRendererConfig.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/TIFFRendererConfig.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/TIFFRendererConfig.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/bitmap/TIFFRendererConfig.java Tue Jun 26 12:31:50 2012
@@ -36,13 +36,13 @@ import org.apache.fop.render.RendererCon
  */
 public final class TIFFRendererConfig extends BitmapRendererConfig {
 
-    public enum TIFFRendererConfigOption implements RendererConfigOption {
+    public enum TIFFRendererOption implements RendererConfigOption {
         COMPRESSION("compression", TIFFCompressionValues.PACKBITS);
 
         private final String name;
         private final Object defaultValue;
 
-        private TIFFRendererConfigOption(String name, Object defaultValue) {
+        private TIFFRendererOption(String name, Object defaultValue) {
             this.name = name;
             this.defaultValue = defaultValue;
         }
@@ -56,15 +56,15 @@ public final class TIFFRendererConfig ex
         }
     }
 
-    private final EnumMap<TIFFRendererConfigOption, Object> params
-            = new EnumMap<TIFFRendererConfigOption, Object>(TIFFRendererConfigOption.class);
+    private final EnumMap<TIFFRendererOption, Object> params
+            = new EnumMap<TIFFRendererOption, Object>(TIFFRendererOption.class);
 
     private TIFFRendererConfig(DefaultFontConfig fontConfig) {
         super(fontConfig);
     }
 
     public TIFFCompressionValues getCompressionType() {
-        return (TIFFCompressionValues) params.get(TIFFRendererConfigOption.COMPRESSION);
+        return (TIFFCompressionValues) params.get(TIFFRendererOption.COMPRESSION);
     }
 
     /**
@@ -78,11 +78,11 @@ public final class TIFFRendererConfig ex
 
         private TIFFRendererConfig config;
 
-        private void setParam(TIFFRendererConfigOption option, Object value) {
+        private void setParam(TIFFRendererOption option, Object value) {
             config.params.put(option, value != null ? value : option.getDefaultValue());
         }
 
-        private String getValue(Configuration cfg, TIFFRendererConfigOption option) {
+        private String getValue(Configuration cfg, TIFFRendererOption option) {
             return cfg.getChild(option.getName()).getValue(null);
         }
 
@@ -92,9 +92,9 @@ public final class TIFFRendererConfig ex
                     .parse(cfg, userAgent.validateStrictly()));
             super.build(config, userAgent, cfg);
             if (cfg != null) {
-            setParam(TIFFRendererConfigOption.COMPRESSION,
+            setParam(TIFFRendererOption.COMPRESSION,
                         TIFFCompressionValues.getValue(getValue(cfg,
-                                TIFFRendererConfigOption.COMPRESSION)));
+                                TIFFRendererOption.COMPRESSION)));
             }
             return config;
         }

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java Tue Jun 26 12:31:50 2012
@@ -29,7 +29,6 @@ import org.apache.commons.logging.LogFac
 import org.apache.fop.apps.io.InternalResourceResolver;
 import org.apache.fop.fonts.CustomFont;
 import org.apache.fop.fonts.EmbedFontInfo;
-import org.apache.fop.fonts.EncodingMode;
 import org.apache.fop.fonts.FontCollection;
 import org.apache.fop.fonts.FontInfo;
 import org.apache.fop.fonts.FontLoader;
@@ -82,10 +81,10 @@ public class ConfiguredFontCollection im
                     InputStream fontSource = resourceResolver.getResource(fontURI);
                     font = new CustomFontMetricsMapper(fontMetrics, fontSource);
                 } else {
-                    CustomFont fontMetrics = FontLoader.loadFont(
-                            fontURI, null, true, configFontInfo.getEmbeddingMode(),
-                            EncodingMode.AUTO, configFontInfo.getKerning(),
-                            configFontInfo.getAdvanced(), resourceResolver);
+                    CustomFont fontMetrics = FontLoader.loadFont(fontURI, null, true,
+                            configFontInfo.getEmbeddingMode(), configFontInfo.getEncodingMode(),
+                            configFontInfo.getKerning(), configFontInfo.getAdvanced(),
+                            resourceResolver);
                     font = new CustomFontMetricsMapper(fontMetrics);
                 }
 

Added: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pcl/Java2DRendererOption.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pcl/Java2DRendererOption.java?rev=1353992&view=auto
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pcl/Java2DRendererOption.java (added)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pcl/Java2DRendererOption.java Tue Jun 26 12:31:50 2012
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.fop.render.pcl;
+
+import org.apache.fop.render.RendererConfigOption;
+
+/**
+ * An enumeration of the renderer configuration options available to the Java2D renderer via the
+ * FOP conf.
+ */
+public enum Java2DRendererOption implements RendererConfigOption {
+
+    RENDERING_MODE("rendering", PCLRenderingMode.class),
+    TEXT_RENDERING("text-rendering", Boolean.class),
+    DISABLE_PJL("disable-pjl", Boolean.class);
+
+    private final String name;
+
+    private final Class<?> type;
+
+    private Java2DRendererOption(String name, Class<?> type) {
+        this.name = name;
+        this.type = type;
+    }
+
+    /** {@inheritDoc} */
+    public String getName() {
+        return name;
+    }
+
+    Class<?> getType() {
+        return type;
+    }
+}

Propchange: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pcl/Java2DRendererOption.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pcl/PCLRendererConfig.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pcl/PCLRendererConfig.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pcl/PCLRendererConfig.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pcl/PCLRendererConfig.java Tue Jun 26 12:31:50 2012
@@ -31,17 +31,17 @@ import org.apache.fop.fonts.DefaultFontC
 import org.apache.fop.fonts.DefaultFontConfig.DefaultFontConfigParser;
 import org.apache.fop.render.RendererConfig;
 
-import static org.apache.fop.render.pcl.Java2DRendererConfigOption.DISABLE_PJL;
-import static org.apache.fop.render.pcl.Java2DRendererConfigOption.RENDERING_MODE;
-import static org.apache.fop.render.pcl.Java2DRendererConfigOption.TEXT_RENDERING;
+import static org.apache.fop.render.pcl.Java2DRendererOption.DISABLE_PJL;
+import static org.apache.fop.render.pcl.Java2DRendererOption.RENDERING_MODE;
+import static org.apache.fop.render.pcl.Java2DRendererOption.TEXT_RENDERING;
 
 /**
  * The PCL renderer configuration data object.
  */
 public final class PCLRendererConfig implements RendererConfig {
 
-    private final Map<Java2DRendererConfigOption, Object> params
-        = new EnumMap<Java2DRendererConfigOption, Object>(Java2DRendererConfigOption.class);
+    private final Map<Java2DRendererOption, Object> params
+        = new EnumMap<Java2DRendererOption, Object>(Java2DRendererOption.class);
 
     private final DefaultFontConfig fontConfig;
 
@@ -65,12 +65,12 @@ public final class PCLRendererConfig imp
         return getParam(DISABLE_PJL, Boolean.class);
     }
 
-    private <T> T getParam(Java2DRendererConfigOption option, Class<T> type) {
+    private <T> T getParam(Java2DRendererOption option, Class<T> type) {
         assert option.getType().equals(type);
         return type.cast(params.get(option));
     }
 
-    private <T> void setParam(Java2DRendererConfigOption option, T value) {
+    private <T> void setParam(Java2DRendererOption option, T value) {
         assert option.getType().isInstance(value);
         params.put(option, value);
     }

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFDocumentHandler.java Tue Jun 26 12:31:50 2012
@@ -125,8 +125,8 @@ public class PDFDocumentHandler extends 
         return this.documentNavigationHandler;
     }
 
-    PDFRenderingUtil getPDFUtil() {
-        return this.pdfUtil;
+    void mergeRendererOptionsConfig(PDFRendererOptionsConfig config) {
+        pdfUtil.mergeRendererOptionsConfig(config);
     }
 
     PDFLogicalStructureHandler getLogicalStructureHandler() {

Added: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFEncryptionOption.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFEncryptionOption.java?rev=1353992&view=auto
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFEncryptionOption.java (added)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFEncryptionOption.java Tue Jun 26 12:31:50 2012
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.render.pdf;
+
+import org.apache.fop.pdf.PDFAMode;
+import org.apache.fop.pdf.PDFXMode;
+import org.apache.fop.render.RendererConfigOption;
+
+public enum PDFEncryptionOption implements RendererConfigOption {
+
+    /**
+     * PDF encryption length parameter: must be a multiple of 8 between 40 and 128,
+     * default value 40, datatype: int, default: 40
+     */
+    ENCRYPTION_LENGTH("encryption-length", 40),
+    /**
+     * PDF encryption parameter: Forbids printing to high quality, datatype: Boolean or
+     * "true"/"false", default: false
+     */
+    NO_PRINTHQ("noprinthq", 40),
+    /**
+     * PDF encryption parameter: Forbids assembling document, datatype: Boolean or
+     * "true"/"false", default: false
+     */
+    NO_ASSEMBLEDOC("noassembledoc", false),
+    /**
+     * PDF encryption parameter: Forbids extracting text and graphics, datatype: Boolean
+     * or "true"/"false", default: false
+     */
+    NO_ACCESSCONTENT("noaccesscontent", false),
+    /**
+     * PDF encryption parameter: Forbids filling in existing interactive forms, datatype:
+     * Boolean or "true"/"false", default: false
+     */
+    NO_FILLINFORMS("nofillinforms", false),
+    /**
+     * PDF encryption parameter: Forbids annotations, datatype: Boolean or "true"/"false",
+     * default: false
+     */
+    NO_ANNOTATIONS("noannotations", false),
+    /**
+     * PDF encryption parameter: Forbids printing, datatype: Boolean or "true"/"false",
+     * default: false
+     */
+    NO_PRINT("noprint", false),
+    /**
+     * PDF encryption parameter: Forbids copying content, datatype: Boolean or "true"/"false",
+     * default: false
+     */
+    NO_COPY_CONTENT("nocopy", false),
+    /**
+     * PDF encryption parameter: Forbids editing content, datatype: Boolean or "true"/"false",
+     * default: false
+     */
+    NO_EDIT_CONTENT("noedit", false),
+    /** PDF encryption parameter: user password, datatype: String, default: "" */
+    USER_PASSWORD("user-password", ""),
+    /** PDF encryption parameter: owner password, datatype: String, default: "" */
+    OWNER_PASSWORD("owner-password", "");
+
+    public static final String ENCRYPTION_PARAMS = "encryption-params";
+
+    private final String name;
+
+    private final Object defaultValue;
+
+    private PDFEncryptionOption(String name, Object defaultValue) {
+        this.name = name;
+        this.defaultValue = defaultValue;
+    }
+
+    private PDFEncryptionOption(String name) {
+        this(name, null);
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public Object getDefaultValue() {
+        return defaultValue;
+    }
+}

Propchange: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFEncryptionOption.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFPainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFPainter.java?rev=1353992&r1=1353991&r2=1353992&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFPainter.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFPainter.java Tue Jun 26 12:31:50 2012
@@ -92,10 +92,6 @@ public class PDFPainter extends Abstract
         return this.documentHandler.getContext();
     }
 
-    PDFRenderingUtil getPDFUtil() {
-        return this.documentHandler.pdfUtil;
-    }
-
     PDFDocument getPDFDoc() {
         return this.documentHandler.pdfDoc;
     }



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