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 ac...@apache.org on 2008/05/12 10:58:23 UTC

svn commit: r655445 [3/4] - in /xmlgraphics/fop/branches/Temp_AFPGOCAResources: ./ src/codegen/fonts/ src/java/org/apache/fop/apps/ src/java/org/apache/fop/fo/ src/java/org/apache/fop/fo/properties/ src/java/org/apache/fop/fonts/ src/java/org/apache/fo...

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPRenderer.java?rev=655445&r1=655444&r2=655445&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPRenderer.java Mon May 12 01:58:21 2008
@@ -502,7 +502,7 @@
 
             AffineTransform positionTransform = new AffineTransform();
             positionTransform.translate(bv.getXOffset(), bv.getYOffset());
-            
+
             //"left/"top" (bv.getX/YOffset()) specify the position of the content rectangle
             positionTransform.translate(-borderPaddingStart, -borderPaddingBefore);
 
@@ -511,7 +511,7 @@
             //saveGraphicsState();
             //Viewport position
             //concatenateTransformationMatrix(mptToPt(positionTransform));
-            
+
             //Background and borders
             float bpwidth = (borderPaddingStart + bv.getBorderAndPaddingWidthEnd()) / 1000f;
             float bpheight = (borderPaddingBefore + bv.getBorderAndPaddingWidthAfter()) / 1000f;
@@ -542,7 +542,7 @@
             //concatenateTransformationMatrix(mptToPt(contentTransform));
             contentRect = new Rectangle2D.Double(0, 0, 1000 * width, 1000 * height);
             pushViewPortPos(new ViewPortPos(contentRect, new CTM(contentTransform)));
-            
+
             currentIPPosition = 0;
             currentBPPosition = 0;
             renderBlocks(bv, children);
@@ -600,7 +600,7 @@
         //Not used here since AFPRenderer defines its own renderBlockViewport() method.
         throw new UnsupportedOperationException("NYI");
     }
-    
+
     /**
      * {@inheritDoc}
      */
@@ -930,7 +930,7 @@
     private static final ImageFlavor[] FLAVORS = new ImageFlavor[]
                                                      {ImageFlavor.RAW_CCITTFAX,
                                                       ImageFlavor.GRAPHICS2D,
-                                                      ImageFlavor.BUFFERED_IMAGE, 
+                                                      ImageFlavor.BUFFERED_IMAGE,
                                                       ImageFlavor.RENDERED_IMAGE,
                                                       ImageFlavor.XML_DOM};
 
@@ -957,12 +957,12 @@
             try {
                 ImageSessionContext sessionContext = getUserAgent().getImageSessionContext();
                 info = manager.getImageInfo(uri, sessionContext);
-                
+
                 //Only now fully load/prepare the image
                 Map hints = ImageUtil.getDefaultHints(sessionContext);
                 org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
                         info, FLAVORS, hints, sessionContext);
-                
+
                 //...and process the image
                 if (img instanceof ImageGraphics2D) {
                     ImageGraphics2D imageG2D = (ImageGraphics2D)img;
@@ -1066,7 +1066,7 @@
                     IOUtils.closeQuietly(in);
                 }
             }
-            
+
             /*
             ImageFactory fact = userAgent.getFactory().getImageFactory();
             FopImage fopimage = fact.getImage(url, userAgent);
@@ -1139,7 +1139,7 @@
                         if (!fopimage.load(FopImage.BITMAP)) {
                             return;
                         }
-                        convertToGrayScaleImage(io, fopimage.getBitmaps(), 
+                        convertToGrayScaleImage(io, fopimage.getBitmaps(),
                                 fopimage.getWidth(), fopimage.getHeight());
                     }
                 } else {
@@ -1474,9 +1474,9 @@
      */
 // UNUSED
 //     public void setOptions(Map options) {
-//    
+//
 //         this.afpOptions = options;
-//    
+//
 //     }
     /**
      * Determines the orientation from the string representation, this method
@@ -1543,7 +1543,7 @@
     /**
      * Sets the rotation to be used for landsacpe pages, valid values are 0, 90,
      * 180, 270 (default).
-     *  
+     * 
      * @param rotation
      *            The rotation in degrees.
      */
@@ -1714,7 +1714,7 @@
         io.setImageIDESize((byte) bitsPerPixel);
         io.setImageData(bw);
     }
-    
+
     private final class ViewPortPos {
         private int x = 0;
 
@@ -1882,7 +1882,7 @@
         }
         this.resolution = resolution;
     }
-    
+
     /**
      * Returns the output/device resolution.
      * @return the resolution in dpi

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/Base14FontCollection.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/Base14FontCollection.java?rev=655445&r1=655444&r2=655445&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/Base14FontCollection.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/Base14FontCollection.java Mon May 12 01:58:21 2008
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: $ */
+/* $Id$ */
 
 package org.apache.fop.render.java2d;
 
@@ -31,7 +31,7 @@
 public class Base14FontCollection implements FontCollection {
 
     private Graphics2D graphics2d = null;
-    
+
     /**
      * Main constructor
      * @param graphics2d a graphics 2D
@@ -39,7 +39,7 @@
     public Base14FontCollection(Graphics2D graphics2d) {
         this.graphics2d = graphics2d;
     }
-    
+
     /**
      * {@inheritDoc}
      */
@@ -175,7 +175,7 @@
         fontInfo.addFontProperties("F8", "Times Roman", Font.STYLE_ITALIC, Font.WEIGHT_BOLD);
         fontInfo.addFontProperties("F9", "Computer-Modern-Typewriter",
                                    "normal", Font.WEIGHT_NORMAL);
-        
+
         return 15;
     }
 }

Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/Base14FontCollection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/Base14FontCollection.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java?rev=655445&r1=655444&r2=655445&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java Mon May 12 01:58:21 2008
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: $ */
+/* $Id$ */
 
 package org.apache.fop.render.java2d;
 
@@ -54,7 +54,7 @@
     public ConfiguredFontCollection(PrintRenderer renderer) {
         this.renderer = renderer;
     }
-    
+
     /**
      * {@inheritDoc}
      */

Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java?rev=655445&r1=655444&r2=655445&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java Mon May 12 01:58:21 2008
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: $ */
+/* $Id$ */
 
 package org.apache.fop.render.java2d;
 
@@ -67,7 +67,7 @@
     public InstalledFontCollection(Graphics2D graphics2D) {
         this.graphics2D  = graphics2D;
     }
-    
+
     /**
      * {@inheritDoc}
      */

Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/Java2DRenderer.java?rev=655445&r1=655444&r2=655445&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/Java2DRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/Java2DRenderer.java Mon May 12 01:58:21 2008
@@ -129,17 +129,17 @@
 
     /** false: paints a non-transparent white background, true: for a transparent background */
     protected boolean transparentPageBackground = false;
-    
+
     /** The current state, holds a Graphics2D and its context */
     protected Java2DGraphicsState state;
-    
+
     private Stack stateStack = new Stack();
 
     /** true if the renderer has finished rendering all the pages */
     private boolean renderingDone;
 
     private GeneralPath currentPath = null;
-    
+
     /** Default constructor */
     public Java2DRenderer() {
     }
@@ -150,7 +150,7 @@
     public void setUserAgent(FOUserAgent foUserAgent) {
         super.setUserAgent(foUserAgent);
         userAgent.setRendererOverride(this); // for document regeneration
-        
+
         String s = (String)userAgent.getRendererOptions().get(JAVA2D_TRANSPARENT_PAGE_BACKGROUND);
         if (s != null) {
             this.transparentPageBackground = "true".equalsIgnoreCase(s);
@@ -173,9 +173,9 @@
                 BufferedImage.TYPE_INT_RGB);
         Graphics2D graphics2D = fontImage.createGraphics();
         //The next line is important to get accurate font metrics!
-        graphics2D.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, 
+        graphics2D.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
                 RenderingHints.VALUE_FRACTIONALMETRICS_ON);
-        
+
         userAgent.getFactory().getFontManager().setupRenderer(this, graphics2D);
     }
 
@@ -218,7 +218,7 @@
     public boolean isRenderingDone() {
         return this.renderingDone;
     }
-    
+
     /**
      * @return The 0-based current page number
      */
@@ -279,7 +279,7 @@
         assert pageViewport.getPageIndex() >= 0;
         pageViewportList.add(pageViewport);
     }
-    
+
     /**
      * Generates a desired page from the renderer's page viewport list.
      *
@@ -300,18 +300,18 @@
                             + " (pageWidth " + pageWidth + ", pageHeight "
                             + pageHeight + ")");
 
-            double scaleX = scaleFactor 
-                * (25.4 / FopFactoryConfigurator.DEFAULT_TARGET_RESOLUTION) 
+            double scaleX = scaleFactor
+                * (25.4 / FopFactoryConfigurator.DEFAULT_TARGET_RESOLUTION)
                 / userAgent.getTargetPixelUnitToMillimeter();
             double scaleY = scaleFactor
                 * (25.4 / FopFactoryConfigurator.DEFAULT_TARGET_RESOLUTION)
                 / userAgent.getTargetPixelUnitToMillimeter();
             int bitmapWidth = (int) ((pageWidth * scaleX) + 0.5);
             int bitmapHeight = (int) ((pageHeight * scaleY) + 0.5);
-                    
-            
+
+
             BufferedImage currentPageImage = getBufferedImage(bitmapWidth, bitmapHeight);
-            
+
             Graphics2D graphics = currentPageImage.createGraphics();
             graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
                     RenderingHints.VALUE_FRACTIONALMETRICS_ON);
@@ -374,7 +374,7 @@
        return new BufferedImage(
                 bitmapWidth, bitmapHeight, BufferedImage.TYPE_INT_ARGB);
     }
-    
+
     /**
      * Returns a page viewport.
      * @param pageIndex the page index (zero-based)
@@ -414,21 +414,21 @@
         state.dispose();
         state = (Java2DGraphicsState)stateStack.pop();
     }
-    
+
     /** {@inheritDoc} */
     protected void concatenateTransformationMatrix(AffineTransform at) {
         state.transform(at);
     }
-    
+
     /** {@inheritDoc} */
     protected void startVParea(CTM ctm, Rectangle2D clippingRect) {
 
         saveGraphicsState();
 
         if (clippingRect != null) {
-            clipRect((float)clippingRect.getX() / 1000f, 
-                    (float)clippingRect.getY() / 1000f, 
-                    (float)clippingRect.getWidth() / 1000f, 
+            clipRect((float)clippingRect.getX() / 1000f,
+                    (float)clippingRect.getY() / 1000f,
+                    (float)clippingRect.getWidth() / 1000f,
                     (float)clippingRect.getHeight() / 1000f);
         }
 
@@ -465,7 +465,7 @@
      */
     protected void restoreStateStackAfterBreakOut(List breakOutList) {
         log.debug("Block.FIXED --> restoring context after break-out");
-        
+
         Iterator i = breakOutList.iterator();
         while (i.hasNext()) {
             Java2DGraphicsState s = (Java2DGraphicsState)i.next();
@@ -475,7 +475,7 @@
     }
 
     /**
-     * {@inheritDoc} 
+     * {@inheritDoc}
      */
     protected void updateColor(Color col, boolean fill) {
         state.updateColor(col);
@@ -500,7 +500,7 @@
     }
 
     /**
-     * {@inheritDoc} 
+     * {@inheritDoc}
      */
     protected void lineTo(float x, float y) {
         if (currentPath == null) {
@@ -510,7 +510,7 @@
     }
 
     /**
-     * {@inheritDoc} 
+     * {@inheritDoc}
      */
     protected void moveTo(float x, float y) {
         if (currentPath == null) {
@@ -520,26 +520,26 @@
     }
 
     /**
-     * {@inheritDoc} 
+     * {@inheritDoc}
      */
     protected void clipRect(float x, float y, float width, float height) {
         state.updateClip(new Rectangle2D.Float(x, y, width, height));
     }
 
     /**
-     * {@inheritDoc} 
+     * {@inheritDoc}
      */
     protected void fillRect(float x, float y, float width, float height) {
         state.getGraph().fill(new Rectangle2D.Float(x, y, width, height));
     }
-    
+
     /**
-     * {@inheritDoc} 
+     * {@inheritDoc}
      */
-    protected void drawBorderLine(float x1, float y1, float x2, float y2, 
+    protected void drawBorderLine(float x1, float y1, float x2, float y2,
             boolean horz, boolean startOrBefore, int style, Color col) {
         Graphics2D g2d = state.getGraph();
-        drawBorderLine(new Rectangle2D.Float(x1, y1, x2 - x1, y2 - y1), 
+        drawBorderLine(new Rectangle2D.Float(x1, y1, x2 - x1, y2 - y1),
                 horz, startOrBefore, style, col, g2d);
     }
 
@@ -547,13 +547,13 @@
      * Draw a border segment of an XSL-FO style border.
      * @param lineRect the line defined by its bounding rectangle
      * @param horz true for horizontal border segments, false for vertical border segments
-     * @param startOrBefore true for border segments on the start or before edge, 
+     * @param startOrBefore true for border segments on the start or before edge,
      *                      false for end or after.
      * @param style the border style (one of Constants.EN_DASHED etc.)
      * @param col the color for the border segment
      * @param g2d the Graphics2D instance to paint to
      */
-    public static void drawBorderLine(Rectangle2D.Float lineRect, 
+    public static void drawBorderLine(Rectangle2D.Float lineRect,
             boolean horz, boolean startOrBefore, int style, Color col, Graphics2D g2d) {
         float x1 = lineRect.x;
         float y1 = lineRect.y;
@@ -566,7 +566,7 @@
             return;
         }
         switch (style) {
-            case Constants.EN_DASHED: 
+            case Constants.EN_DASHED:
                 g2d.setColor(col);
                 if (horz) {
                     float unit = Math.abs(2 * h);
@@ -576,7 +576,7 @@
                     }
                     unit = w / rep;
                     float ym = y1 + (h / 2);
-                    BasicStroke s = new BasicStroke(h, BasicStroke.CAP_BUTT, 
+                    BasicStroke s = new BasicStroke(h, BasicStroke.CAP_BUTT,
                             BasicStroke.JOIN_MITER, 10.0f, new float[] {unit}, 0);
                     g2d.setStroke(s);
                     g2d.draw(new Line2D.Float(x1, ym, x2, ym));
@@ -588,7 +588,7 @@
                     }
                     unit = h / rep;
                     float xm = x1 + (w / 2);
-                    BasicStroke s = new BasicStroke(w, BasicStroke.CAP_BUTT, 
+                    BasicStroke s = new BasicStroke(w, BasicStroke.CAP_BUTT,
                             BasicStroke.JOIN_MITER, 10.0f, new float[] {unit}, 0);
                     g2d.setStroke(s);
                     g2d.draw(new Line2D.Float(xm, y1, xm, y2));
@@ -604,7 +604,7 @@
                     }
                     unit = w / rep;
                     float ym = y1 + (h / 2);
-                    BasicStroke s = new BasicStroke(h, BasicStroke.CAP_ROUND, 
+                    BasicStroke s = new BasicStroke(h, BasicStroke.CAP_ROUND,
                             BasicStroke.JOIN_MITER, 10.0f, new float[] {0, unit}, 0);
                     g2d.setStroke(s);
                     g2d.draw(new Line2D.Float(x1, ym, x2, ym));
@@ -616,7 +616,7 @@
                     }
                     unit = h / rep;
                     float xm = x1 + (w / 2);
-                    BasicStroke s = new BasicStroke(w, BasicStroke.CAP_ROUND, 
+                    BasicStroke s = new BasicStroke(w, BasicStroke.CAP_ROUND,
                             BasicStroke.JOIN_MITER, 10.0f, new float[] {0, unit}, 0);
                     g2d.setStroke(s);
                     g2d.draw(new Line2D.Float(xm, y1, xm, y2));
@@ -722,7 +722,7 @@
         state.transform(at);
         renderText(text, state.getGraph(), font);
         restoreGraphicsState();
-        
+
         currentIPPosition = saveIP + text.getAllocIPD();
         //super.renderText(text);
 
@@ -755,8 +755,8 @@
                 int[] letterAdjust = word.getLetterAdjustArray();
                 GlyphVector gv = g2d.getFont().createGlyphVector(g2d.getFontRenderContext(), s);
                 double additionalWidth = 0.0;
-                if (letterAdjust == null 
-                        && text.getTextLetterSpaceAdjust() == 0 
+                if (letterAdjust == null
+                        && text.getTextLetterSpaceAdjust() == 0
                         && text.getTextWordSpaceAdjust() == 0) {
                     //nop
                 } else {
@@ -776,8 +776,8 @@
                 SpaceArea space = (SpaceArea)child;
                 String s = space.getSpace();
                 char sp = s.charAt(0);
-                int tws = (space.isAdjustable() 
-                        ? text.getTextWordSpaceAdjust() 
+                int tws = (space.isAdjustable()
+                        ? text.getTextWordSpaceAdjust()
                                 + 2 * text.getTextLetterSpaceAdjust()
                         : 0);
 
@@ -787,8 +787,8 @@
             }
         }
     }
-    
-    private static int[] getGlyphOffsets(String s, Font font, TextArea text, 
+
+    private static int[] getGlyphOffsets(String s, Font font, TextArea text,
             int[] letterAdjust) {
         int textLen = s.length();
         int[] offsets = new int[textLen];
@@ -804,11 +804,11 @@
             }
             int cw = font.getWidth(mapped);
             int ladj = (letterAdjust != null && i < textLen - 1 ? letterAdjust[i + 1] : 0);
-            int tls = (i < textLen - 1 ? text.getTextLetterSpaceAdjust() : 0); 
+            int tls = (i < textLen - 1 ? text.getTextLetterSpaceAdjust() : 0);
             offsets[i] = cw + ladj + tls + wordSpace;
         }
         return offsets;
-    }    
+    }
 
     /**
      * Render leader area. This renders a leader area which is an area with a
@@ -824,7 +824,7 @@
 
         float startx = (currentIPPosition + area.getBorderAndPaddingWidthStart()) / 1000f;
         float starty = ((currentBPPosition + area.getOffset()) / 1000f);
-        float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart() 
+        float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart()
                 + area.getIPD()) / 1000f;
 
         Color col = (Color) area.getTrait(Trait.COLOR);
@@ -839,7 +839,7 @@
         case EN_SOLID:
         case EN_DASHED:
         case EN_DOUBLE:
-            drawBorderLine(startx, starty, endx, starty + ruleThickness, 
+            drawBorderLine(startx, starty, endx, starty + ruleThickness,
                     true, true, style, col);
             break;
         case EN_DOTTED:
@@ -905,7 +905,7 @@
         int x = currentIPPosition + (int)Math.round(pos.getX());
         int y = currentBPPosition + (int)Math.round(pos.getY());
         uri = URISpecification.getURL(uri);
-        
+
         ImageManager manager = getUserAgent().getFactory().getImageManager();
         ImageInfo info = null;
         try {
@@ -913,8 +913,8 @@
             info = manager.getImageInfo(uri, sessionContext);
             final ImageFlavor[] flavors = new ImageFlavor[]
                 {ImageFlavor.GRAPHICS2D,
-                    ImageFlavor.BUFFERED_IMAGE, 
-                    ImageFlavor.RENDERED_IMAGE, 
+                    ImageFlavor.BUFFERED_IMAGE,
+                    ImageFlavor.RENDERED_IMAGE,
                     ImageFlavor.XML_DOM};
             Map hints = ImageUtil.getDefaultHints(sessionContext);
             org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
@@ -958,7 +958,7 @@
     }
 
     /** {@inheritDoc} */
-    protected RendererContext createRendererContext(int x, int y, int width, int height, 
+    protected RendererContext createRendererContext(int x, int y, int width, int height,
             Map foreignAttributes) {
         RendererContext context = super.createRendererContext(
                 x, y, width, height, foreignAttributes);

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLRenderer.java?rev=655445&r1=655444&r2=655445&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pcl/PCLRenderer.java Mon May 12 01:58:21 2008
@@ -16,7 +16,7 @@
  */
 
 /* $Id$ */
- 
+
 package org.apache.fop.render.pcl;
 
 //Java
@@ -111,14 +111,14 @@
     /** The MIME type for PCL */
     public static final String MIME_TYPE = MimeConstants.MIME_PCL_ALT;
 
-    private static final QName CONV_MODE 
+    private static final QName CONV_MODE
             = new QName(ExtensionElementMapping.URI, null, "conversion-mode");
-    private static final QName SRC_TRANSPARENCY 
+    private static final QName SRC_TRANSPARENCY
             = new QName(ExtensionElementMapping.URI, null, "source-transparency");
-    
+
     /** The OutputStream to write the PCL stream to */
     protected OutputStream out;
-    
+
     /** The PCL generator */
     protected PCLGenerator gen;
     private boolean ioTrouble = false;
@@ -130,13 +130,13 @@
     private int currentPrintDirection = 0;
     private GeneralPath currentPath = null;
     private java.awt.Color currentFillColor = null;
-    
+
     /**
      * Controls whether appearance is more important than speed. False can cause some FO feature
-     * to be ignored (like the advanced borders). 
+     * to be ignored (like the advanced borders).
      */
     private boolean qualityBeforeSpeed = false;
-    
+
     /**
      * Controls whether all text should be painted as text. This is a fallback setting in case
      * the mixture of native and bitmapped text does not provide the necessary quality.
@@ -149,17 +149,17 @@
      * this to true will increase memory consumption.
      */
     private boolean useColorCanvas = false;
-    
+
     /**
-     * Controls whether the generation of PJL commands gets disabled. 
+     * Controls whether the generation of PJL commands gets disabled.
      */
     private boolean disabledPJL = false;
-    
+
     /** contains the pageWith of the last printed page */
     private long pageWidth = 0;
     /** contains the pageHeight of the last printed page */
     private long pageHeight = 0;
-    
+
     /**
      * Create the PCL renderer
      */
@@ -182,7 +182,7 @@
     public void setPJLDisabled(boolean disable) {
         this.disabledPJL = disable;
     }
-    
+
     /**
      * Indicates whether PJL generation is disabled.
      * @return true if PJL generation is disabled.
@@ -190,7 +190,7 @@
     public boolean isPJLDisabled() {
         return this.disabledPJL;
     }
-    
+
     /**
      * {@inheritDoc}
      */
@@ -203,9 +203,9 @@
                 BufferedImage.TYPE_INT_RGB);
         Graphics2D graphics2D = fontImage.createGraphics();
         //The next line is important to get accurate font metrics!
-        graphics2D.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, 
+        graphics2D.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
                 RenderingHints.VALUE_FRACTIONALMETRICS_ON);
-        
+
         userAgent.getFactory().getFontManager().setupRenderer(this, graphics2D);
     }
 
@@ -231,7 +231,7 @@
     public GraphicContext getGraphicContext() {
         return this.graphicContext;
     }
-    
+
     /** @return the target resolution */
     protected int getResolution() {
         int resolution = (int)Math.round(userAgent.getTargetResolution());
@@ -241,7 +241,7 @@
             return 600;
         }
     }
-    
+
     /**
      * Sets the current font (NOTE: Hard-coded font mappings ATM!)
      * @param name the font name (internal F* names for now)
@@ -317,25 +317,25 @@
         case 9:     // F9 = Courier
 
             gen.writeCommand("(0N");
-            gen.writeCommand("(s0p" + gen.formatDouble2(120.01f / (size / 1000.00f)) 
+            gen.writeCommand("(s0p" + gen.formatDouble2(120.01f / (size / 1000.00f))
                     + "h0s0b4099T");
             break;
         case 10:    // F10 = Courier Oblique
 
             gen.writeCommand("(0N");
-            gen.writeCommand("(s0p" + gen.formatDouble2(120.01f / (size / 1000.00f)) 
+            gen.writeCommand("(s0p" + gen.formatDouble2(120.01f / (size / 1000.00f))
                     + "h1s0b4099T");
             break;
         case 11:    // F11 = Courier Bold
 
             gen.writeCommand("(0N");
-            gen.writeCommand("(s0p" + gen.formatDouble2(120.01f / (size / 1000.00f)) 
+            gen.writeCommand("(s0p" + gen.formatDouble2(120.01f / (size / 1000.00f))
                     + "h0s3b4099T");
             break;
         case 12:    // F12 = Courier Bold Oblique
 
             gen.writeCommand("(0N");
-            gen.writeCommand("(s0p" + gen.formatDouble2(120.01f / (size / 1000.00f)) 
+            gen.writeCommand("(s0p" + gen.formatDouble2(120.01f / (size / 1000.00f))
                     + "h1s3b4099T");
             break;
         case 13:    // F13 = Symbol
@@ -400,52 +400,52 @@
      */
     public void renderPage(PageViewport page) throws IOException, FOPException {
         saveGraphicsState();
-        
+
         //Paper source
         String paperSource = page.getForeignAttributeValue(
                 new QName(PCLElementMapping.NAMESPACE, null, "paper-source"));
         if (paperSource != null) {
             gen.selectPaperSource(Integer.parseInt(paperSource));
         }
-        
+
         //Page size
         final long pagewidth = Math.round(page.getViewArea().getWidth());
         final long pageheight = Math.round(page.getViewArea().getHeight());
         selectPageFormat(pagewidth, pageheight);
-        
+
         super.renderPage(page);
-        
+
         //Eject page
         gen.formFeed();
         restoreGraphicsState();
     }
 
     private void selectPageFormat(long pagewidth, long pageheight) throws IOException {
-        //Only set the page format if it changes (otherwise duplex printing won't work) 
+        //Only set the page format if it changes (otherwise duplex printing won't work)
         if ((pagewidth != this.pageWidth) || (pageheight != this.pageHeight))  {
             this.pageWidth = pagewidth;
             this.pageHeight = pageheight;
-            
+
             this.currentPageDefinition = PCLPageDefinition.getPageDefinition(
                     pagewidth, pageheight, 1000);
-            
+
             if (this.currentPageDefinition == null) {
                 this.currentPageDefinition = PCLPageDefinition.getDefaultPageDefinition();
-                log.warn("Paper type could not be determined. Falling back to: " 
+                log.warn("Paper type could not be determined. Falling back to: "
                         + this.currentPageDefinition.getName());
             }
             if (log.isDebugEnabled()) {
                 log.debug("page size: " + currentPageDefinition.getPhysicalPageSize());
                 log.debug("logical page: " + currentPageDefinition.getLogicalPageRect());
             }
-            
+
             if (this.currentPageDefinition.isLandscapeFormat()) {
                 gen.writeCommand("&l1O"); //Landscape Orientation
             } else {
                 gen.writeCommand("&l0O"); //Portrait Orientation
             }
             gen.selectPageSize(this.currentPageDefinition.getSelector());
-            
+
             gen.clearHorizontalMargins();
             gen.setTopMargin(0);
         }
@@ -461,7 +461,7 @@
     protected void restoreGraphicsState() {
         graphicContext = (GraphicContext)graphicContextStack.pop();
     }
-    
+
     /**
      * Clip an area. write a clipping operation given coordinates in the current
      * transform. Coordinates are in points.
@@ -478,7 +478,7 @@
     private Point2D transformedPoint(float x, float y) {
         return transformedPoint(Math.round(x), Math.round(y));
     }
-    
+
     private Point2D transformedPoint(int x, int y) {
         AffineTransform at = graphicContext.getTransform();
         if (log.isTraceEnabled()) {
@@ -488,7 +488,7 @@
         Point2D.Float transPoint = new Point2D.Float();
         at.transform(orgPoint, transPoint);
         //At this point we have the absolute position in FOP's coordinate system
-        
+
         //Now get PCL coordinates taking the current print direction and the logical page
         //into account.
         Dimension pageSize = currentPageDefinition.getPhysicalPageSize();
@@ -527,18 +527,18 @@
         }
         return transPoint;
     }
-    
+
     private void changePrintDirection() {
         AffineTransform at = graphicContext.getTransform();
         int newDir;
         try {
-            if (at.getScaleX() == 0 && at.getScaleY() == 0 
+            if (at.getScaleX() == 0 && at.getScaleY() == 0
                     && at.getShearX() == 1 && at.getShearY() == -1) {
                 newDir = 90;
-            } else if (at.getScaleX() == -1 && at.getScaleY() == -1 
+            } else if (at.getScaleX() == -1 && at.getScaleY() == -1
                     && at.getShearX() == 0 && at.getShearY() == 0) {
                 newDir = 180;
-            } else if (at.getScaleX() == 0 && at.getScaleY() == 0 
+            } else if (at.getScaleX() == 0 && at.getScaleY() == 0
                     && at.getShearX() == -1 && at.getShearY() == 1) {
                 newDir = 270;
             } else {
@@ -588,7 +588,7 @@
     protected void handleBlockTraits(Block block) {
         int borderPaddingStart = block.getBorderAndPaddingWidthStart();
         int borderPaddingBefore = block.getBorderAndPaddingWidthBefore();
-        
+
         float startx = currentIPPosition / 1000f;
         float starty = currentBPPosition / 1000f;
         float width = block.getIPD() / 1000f;
@@ -628,7 +628,7 @@
      */
     protected void renderText(final TextArea text) {
         renderInlineAreaBackAndBorders(text);
-        
+
         String fontname = getInternalFontNameForArea(text);
         final int fontsize = text.getTraitAsInteger(Trait.FONT_SIZE);
 
@@ -640,9 +640,9 @@
         try {
 
             final Color col = (Color)text.getTrait(Trait.COLOR);
-            boolean pclFont = allTextAsBitmaps 
+            boolean pclFont = allTextAsBitmaps
                     ? false
-                    : setFont(fontname, fontsize, text.getText()); 
+                    : setFont(fontname, fontsize, text.getText());
             if (pclFont) {
                 //this.currentFill = col;
                 if (col != null) {
@@ -650,7 +650,7 @@
                     gen.setTransparencyMode(true, false);
                     gen.selectGrayscale(col);
                 }
-                
+
                 saveGraphicsState();
                 graphicContext.translate(rx, bl);
                 setCursorPos(0, 0);
@@ -667,25 +667,25 @@
                 //Use Java2D to paint different fonts via bitmap
                 final Font font = getFontFromArea(text);
                 final int baseline = text.getBaselineOffset();
-                
+
                 //for cursive fonts, so the text isn't clipped
                 int extraWidth = font.getFontSize() / 3;
                 final FontMetricsMapper mapper = (FontMetricsMapper)fontInfo.getMetricsFor(
                         font.getFontName());
                 int maxAscent = mapper.getMaxAscent(font.getFontSize()) / 1000;
                 final int additionalBPD = maxAscent - baseline;
-                
+
                 Graphics2DAdapter g2a = getGraphics2DAdapter();
                 final Rectangle paintRect = new Rectangle(
                         rx, currentBPPosition + text.getOffset() - additionalBPD,
                         text.getIPD() + extraWidth, text.getBPD() + additionalBPD);
-                RendererContext rc = createRendererContext(paintRect.x, paintRect.y, 
+                RendererContext rc = createRendererContext(paintRect.x, paintRect.y,
                         paintRect.width, paintRect.height, null);
                 Map atts = new java.util.HashMap();
                 atts.put(CONV_MODE, "bitmap");
                 atts.put(SRC_TRANSPARENCY, "true");
                 rc.setProperty(RendererContextConstants.FOREIGN_ATTRIBUTES, atts);
-                
+
                 Graphics2DImagePainter painter = new Graphics2DImagePainter() {
 
                     public void paint(Graphics2D g2d, Rectangle2D area) {
@@ -696,17 +696,17 @@
                         Java2DRenderer.renderText(text, g2d, font);
                         renderTextDecoration(g2d, mapper, fontsize, text, 0, 0);
                     }
-                    
+
                     public Dimension getImageSize() {
                         return paintRect.getSize();
                     }
-                    
+
                 };
-                g2a.paintImage(painter, rc, 
+                g2a.paintImage(painter, rc,
                         paintRect.x, paintRect.y, paintRect.width, paintRect.height);
                 currentIPPosition = saveIP + text.getAllocIPD();
             }
-        
+
         } catch (IOException ioe) {
             handleIOTrouble(ioe);
         }
@@ -721,11 +721,11 @@
      * @param baseline position of the baseline
      * @param startx start IPD
      */
-    private static void renderTextDecoration(Graphics2D g2d, 
-                    FontMetrics fm, int fontsize, InlineArea inline, 
+    private static void renderTextDecoration(Graphics2D g2d,
+                    FontMetrics fm, int fontsize, InlineArea inline,
                     int baseline, int startx) {
-        boolean hasTextDeco = inline.hasUnderline() 
-                || inline.hasOverline() 
+        boolean hasTextDeco = inline.hasUnderline()
+                || inline.hasOverline()
                 || inline.hasLineThrough();
         if (hasTextDeco) {
             float descender = fm.getDescender(fontsize) / 1000f;
@@ -737,7 +737,7 @@
                 g2d.setColor(ct);
                 float y = baseline - descender / 2f;
                 g2d.setStroke(new BasicStroke(lineWidth));
-                g2d.draw(new Line2D.Float(startx / 1000f, y / 1000f, 
+                g2d.draw(new Line2D.Float(startx / 1000f, y / 1000f,
                         endx, y / 1000f));
             }
             if (inline.hasOverline()) {
@@ -745,7 +745,7 @@
                 g2d.setColor(ct);
                 float y = (float)(baseline - (1.1 * capHeight));
                 g2d.setStroke(new BasicStroke(lineWidth));
-                g2d.draw(new Line2D.Float(startx / 1000f, y / 1000f, 
+                g2d.draw(new Line2D.Float(startx / 1000f, y / 1000f,
                         endx, y / 1000f));
             }
             if (inline.hasLineThrough()) {
@@ -753,12 +753,12 @@
                 g2d.setColor(ct);
                 float y = (float)(baseline - (0.45 * capHeight));
                 g2d.setStroke(new BasicStroke(lineWidth));
-                g2d.draw(new Line2D.Float(startx / 1000f, y / 1000f, 
+                g2d.draw(new Line2D.Float(startx / 1000f, y / 1000f,
                         endx, y / 1000f));
             }
         }
     }
-    
+
     /**
      * Sets the current cursor position. The coordinates are transformed to the absolute position
      * on the logical PCL page and then passed on to the PCLGenerator.
@@ -784,7 +784,7 @@
     }
 
     /**
-     * Closes the current subpath by appending a straight line segment from 
+     * Closes the current subpath by appending a straight line segment from
      * the current point to the starting point of the subpath.
      */
     protected void closePath() {
@@ -792,8 +792,8 @@
     }
 
     /**
-     * Appends a straight line segment from the current point to (x, y). The 
-     * new current point is (x, y). 
+     * Appends a straight line segment from the current point to (x, y). The
+     * new current point is (x, y).
      * @param x x coordinate
      * @param y y coordinate
      */
@@ -805,7 +805,7 @@
     }
 
     /**
-     * Moves the current point to (x, y), omitting any connecting line segment. 
+     * Moves the current point to (x, y), omitting any connecting line segment.
      * @param x x coordinate
      * @param y y coordinate
      */
@@ -815,7 +815,7 @@
         }
         currentPath.moveTo(x, y);
     }
-    
+
     /**
      * Fill a rectangular area.
      * @param x the x coordinate (in pt)
@@ -826,13 +826,13 @@
     protected void fillRect(float x, float y, float width, float height) {
         try {
             setCursorPos(x * 1000, y * 1000);
-            gen.fillRect((int)(width * 1000), (int)(height * 1000), 
+            gen.fillRect((int)(width * 1000), (int)(height * 1000),
                     this.currentFillColor);
         } catch (IOException ioe) {
             handleIOTrouble(ioe);
         }
     }
-    
+
     /**
      * Sets the new current fill color.
      * @param color the color
@@ -866,9 +866,9 @@
         String s = space.getSpace();
         char sp = s.charAt(0);
         Font font = getFontFromArea(textArea);
-        
-        int tws = (space.isAdjustable() 
-                ? textArea.getTextWordSpaceAdjust() 
+
+        int tws = (space.isAdjustable()
+                ? textArea.getTextWordSpaceAdjust()
                         + 2 * textArea.getTextLetterSpaceAdjust()
                 : 0);
 
@@ -893,10 +893,10 @@
         float y = (currentBPPosition + viewport.getOffset()) / 1000f;
         float width = viewport.getIPD() / 1000f;
         float height = viewport.getBPD() / 1000f;
-        // TODO: Calculate the border rect correctly. 
+        // TODO: Calculate the border rect correctly.
         float borderPaddingStart = viewport.getBorderAndPaddingWidthStart() / 1000f;
         float borderPaddingBefore = viewport.getBorderAndPaddingWidthBefore() / 1000f;
-        float bpwidth = borderPaddingStart 
+        float bpwidth = borderPaddingStart
                 + (viewport.getBorderAndPaddingWidthEnd() / 1000f);
         float bpheight = borderPaddingBefore
                 + (viewport.getBorderAndPaddingWidthAfter() / 1000f);
@@ -931,7 +931,7 @@
         //This is the content-rect
         float width = (float)bv.getIPD() / 1000f;
         float height = (float)bv.getBPD() / 1000f;
-        
+
 
         if (bv.getPositioning() == Block.ABSOLUTE
                 || bv.getPositioning() == Block.FIXED) {
@@ -943,17 +943,17 @@
             if (bv.getPositioning() == Block.FIXED) {
                 breakOutList = breakOutOfStateStack();
             }
-            
+
             AffineTransform positionTransform = new AffineTransform();
             positionTransform.translate(bv.getXOffset(), bv.getYOffset());
-            
+
             //"left/"top" (bv.getX/YOffset()) specify the position of the content rectangle
             positionTransform.translate(-borderPaddingStart, -borderPaddingBefore);
 
             saveGraphicsState();
             //Viewport position
             concatenateTransformationMatrix(mptToPt(positionTransform));
-            
+
             //Background and borders
             float bpwidth = (borderPaddingStart + bv.getBorderAndPaddingWidthEnd()) / 1000f;
             float bpheight = (borderPaddingBefore + bv.getBorderAndPaddingWidthAfter()) / 1000f;
@@ -963,7 +963,7 @@
             AffineTransform contentRectTransform = new AffineTransform();
             contentRectTransform.translate(borderPaddingStart, borderPaddingBefore);
             concatenateTransformationMatrix(mptToPt(contentRectTransform));
-            
+
             //Clipping
             if (bv.getClip()) {
                 clipRect(0f, 0f, width, height);
@@ -973,7 +973,7 @@
             //Set up coordinate system for content rectangle
             AffineTransform contentTransform = ctm.toAffineTransform();
             concatenateTransformationMatrix(mptToPt(contentTransform));
-            
+
             currentIPPosition = 0;
             currentBPPosition = 0;
             renderBlocks(bv, children);
@@ -984,7 +984,7 @@
             if (breakOutList != null) {
                 restoreStateStackAfterBreakOut(breakOutList);
             }
-            
+
             currentIPPosition = saveIP;
             currentBPPosition = saveBP;
         } else {
@@ -999,16 +999,16 @@
 
             CTM tempctm = new CTM(containingIPPosition, currentBPPosition);
             ctm = tempctm.multiply(ctm);
-            
+
             //Now adjust for border/padding
             currentBPPosition += borderPaddingBefore;
 
             Rectangle2D clippingRect = null;
             if (bv.getClip()) {
-                clippingRect = new Rectangle(currentIPPosition, currentBPPosition, 
+                clippingRect = new Rectangle(currentIPPosition, currentBPPosition,
                         bv.getIPD(), bv.getBPD());
             }
-            
+
             startVParea(ctm, clippingRect);
             currentIPPosition = 0;
             currentBPPosition = 0;
@@ -1017,7 +1017,7 @@
 
             currentIPPosition = saveIP;
             currentBPPosition = saveBP;
-            
+
             currentBPPosition += (int)(bv.getAllocBPD());
         }
         //currentFontName = saveFontName;
@@ -1034,7 +1034,7 @@
             changePrintDirection();
         }
     }
-    
+
     private List breakOutOfStateStack() {
         log.debug("Block.FIXED --> break out");
         List breakOutList = new java.util.ArrayList();
@@ -1054,7 +1054,7 @@
     }
 
     /** {@inheritDoc} */
-    protected RendererContext createRendererContext(int x, int y, int width, int height, 
+    protected RendererContext createRendererContext(int x, int y, int width, int height,
             Map foreignAttributes) {
         RendererContext context = super.createRendererContext(
                 x, y, width, height, foreignAttributes);
@@ -1070,7 +1070,7 @@
 
     private static final ImageFlavor[] FLAVORS = new ImageFlavor[]
                                              {ImageFlavor.GRAPHICS2D,
-                                              ImageFlavor.BUFFERED_IMAGE, 
+                                              ImageFlavor.BUFFERED_IMAGE,
                                               ImageFlavor.RENDERED_IMAGE,
                                               ImageFlavor.XML_DOM};
     /**
@@ -1089,18 +1089,18 @@
         Point origin = new Point(currentIPPosition, currentBPPosition);
         int x = origin.x + posInt.x;
         int y = origin.y + posInt.y;
-        
+
         ImageManager manager = getUserAgent().getFactory().getImageManager();
         ImageInfo info = null;
         try {
             ImageSessionContext sessionContext = getUserAgent().getImageSessionContext();
             info = manager.getImageInfo(uri, sessionContext);
-            
+
             //Only now fully load/prepare the image
             Map hints = ImageUtil.getDefaultHints(sessionContext);
             org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
                     info, FLAVORS, hints, sessionContext);
-            
+
             //...and process the image
             if (img instanceof ImageGraphics2D) {
                 ImageGraphics2D imageG2D = (ImageGraphics2D)img;
@@ -1113,8 +1113,8 @@
                 ImageRendered imgRend = (ImageRendered)img;
                 RenderedImage ri = imgRend.getRenderedImage();
                 setCursorPos(x, y);
-                gen.paintBitmap(ri, 
-                        new Dimension(posInt.width, posInt.height), 
+                gen.paintBitmap(ri,
+                        new Dimension(posInt.width, posInt.height),
                         false);
             } else if (img instanceof ImageXMLDOM) {
                 ImageXMLDOM imgXML = (ImageXMLDOM)img;
@@ -1160,18 +1160,18 @@
         float height = area.getBPD() / 1000f;
         float borderPaddingStart = area.getBorderAndPaddingWidthStart() / 1000f;
         float borderPaddingBefore = area.getBorderAndPaddingWidthBefore() / 1000f;
-        float bpwidth = borderPaddingStart 
+        float bpwidth = borderPaddingStart
                 + (area.getBorderAndPaddingWidthEnd() / 1000f);
         float bpheight = borderPaddingBefore
                 + (area.getBorderAndPaddingWidthAfter() / 1000f);
-        
+
         if (height != 0.0f || bpheight != 0.0f && bpwidth != 0.0f) {
             drawBackAndBorders(area, x, y - borderPaddingBefore
                                 , width + bpwidth
                                 , height + bpheight);
         }
     }
-    
+
     /**
      * Draw the background and borders. This draws the background and border
      * traits for an area given the position.
@@ -1188,18 +1188,18 @@
         BorderProps bpsAfter = (BorderProps) area.getTrait(Trait.BORDER_AFTER);
         BorderProps bpsStart = (BorderProps) area.getTrait(Trait.BORDER_START);
         BorderProps bpsEnd = (BorderProps) area.getTrait(Trait.BORDER_END);
-    
+
         // draw background
         Trait.Background back;
         back = (Trait.Background) area.getTrait(Trait.BACKGROUND);
         if (back != null) {
-    
+
             // Calculate padding rectangle
             float sx = startx;
             float sy = starty;
             float paddRectWidth = width;
             float paddRectHeight = height;
-    
+
             if (bpsStart != null) {
                 sx += bpsStart.width / 1000f;
                 paddRectWidth -= bpsStart.width / 1000f;
@@ -1214,15 +1214,15 @@
             if (bpsAfter != null) {
                 paddRectHeight -= bpsAfter.width / 1000f;
             }
-    
+
             if (back.getColor() != null) {
                 updateFillColor(back.getColor());
                 fillRect(sx, sy, paddRectWidth, paddRectHeight);
             }
-    
+
             // background image
             if (back.getImageInfo() != null) {
-                ImageSize imageSize = back.getImageInfo().getSize(); 
+                ImageSize imageSize = back.getImageInfo().getSize();
                 saveGraphicsState();
                 clipRect(sx, sy, paddRectWidth, paddRectHeight);
                 int horzCount = (int) ((paddRectWidth * 1000 / imageSize.getWidthMpt()) + 1.0f);
@@ -1250,7 +1250,7 @@
                         Rectangle2D pos;
                         // Image positions are relative to the currentIP/BP
                         pos = new Rectangle2D.Float(
-                                sx - currentIPPosition 
+                                sx - currentIPPosition
                                     + (x * imageSize.getWidthMpt()),
                                 sy - currentBPPosition
                                     + (y * imageSize.getHeightMpt()),
@@ -1262,7 +1262,7 @@
                 restoreGraphicsState();
             }
         }
-        
+
         Rectangle2D.Float borderRect = new Rectangle2D.Float(startx, starty, width, height);
         drawBorders(borderRect, bpsBefore, bpsAfter, bpsStart, bpsEnd);
     }
@@ -1275,8 +1275,8 @@
      * @param bpsStart the border specification on the start side
      * @param bpsEnd the border specification on the end side
      */
-    protected void drawBorders(Rectangle2D.Float borderRect, 
-            final BorderProps bpsBefore, final BorderProps bpsAfter, 
+    protected void drawBorders(Rectangle2D.Float borderRect,
+            final BorderProps bpsBefore, final BorderProps bpsAfter,
             final BorderProps bpsStart, final BorderProps bpsEnd) {
         if (bpsBefore == null && bpsAfter == null && bpsStart == null && bpsEnd == null) {
             return; //no borders to paint
@@ -1287,7 +1287,7 @@
             drawFastBorders(borderRect, bpsBefore, bpsAfter, bpsStart, bpsEnd);
         }
     }
-    
+
     /**
      * Draws borders. Borders are drawn as shaded rectangles with no clipping.
      * @param borderRect the border rectangle
@@ -1296,8 +1296,8 @@
      * @param bpsStart the border specification on the start side
      * @param bpsEnd the border specification on the end side
      */
-    protected void drawFastBorders(Rectangle2D.Float borderRect, 
-            final BorderProps bpsBefore, final BorderProps bpsAfter, 
+    protected void drawFastBorders(Rectangle2D.Float borderRect,
+            final BorderProps bpsBefore, final BorderProps bpsAfter,
             final BorderProps bpsStart, final BorderProps bpsEnd) {
         float startx = borderRect.x;
         float starty = borderRect.y;
@@ -1311,7 +1311,7 @@
         if (bpsAfter != null) {
             float borderWidth = bpsAfter.width / 1000f;
             updateFillColor(bpsAfter.color);
-            fillRect(startx, (starty + height - borderWidth), 
+            fillRect(startx, (starty + height - borderWidth),
                     width, borderWidth);
         }
         if (bpsStart != null) {
@@ -1325,7 +1325,7 @@
             fillRect((startx + width - borderWidth), starty, borderWidth, height);
         }
     }
-    
+
     /**
      * Draws borders. Borders are drawn in-memory and painted as a bitmap.
      * @param borderRect the border rectangle
@@ -1334,8 +1334,8 @@
      * @param bpsStart the border specification on the start side
      * @param bpsEnd the border specification on the end side
      */
-    protected void drawQualityBorders(Rectangle2D.Float borderRect, 
-            final BorderProps bpsBefore, final BorderProps bpsAfter, 
+    protected void drawQualityBorders(Rectangle2D.Float borderRect,
+            final BorderProps bpsBefore, final BorderProps bpsAfter,
             final BorderProps bpsStart, final BorderProps bpsEnd) {
         Graphics2DAdapter g2a = getGraphics2DAdapter();
         final Rectangle.Float effBorderRect = new Rectangle2D.Float(
@@ -1345,7 +1345,7 @@
                  borderRect.height);
         final Rectangle paintRect = new Rectangle(
                 (int)Math.round(borderRect.x * 1000f),
-                (int)Math.round(borderRect.y * 1000f), 
+                (int)Math.round(borderRect.y * 1000f),
                 (int)Math.floor(borderRect.width * 1000f) + 1,
                 (int)Math.floor(borderRect.height * 1000f) + 1);
         //Add one pixel wide safety margin around the paint area
@@ -1356,14 +1356,14 @@
         paintRect.y += yoffset;
         paintRect.width += 2 * pixelWidth;
         paintRect.height += 2 * pixelWidth;
-        
-        RendererContext rc = createRendererContext(paintRect.x, paintRect.y, 
+
+        RendererContext rc = createRendererContext(paintRect.x, paintRect.y,
                 paintRect.width, paintRect.height, null);
         Map atts = new java.util.HashMap();
         atts.put(CONV_MODE, "bitmap");
         atts.put(SRC_TRANSPARENCY, "true");
         rc.setProperty(RendererContextConstants.FOREIGN_ATTRIBUTES, atts);
-        
+
         Graphics2DImagePainter painter = new Graphics2DImagePainter() {
 
             public void paint(Graphics2D g2d, Rectangle2D area) {
@@ -1374,7 +1374,7 @@
                 float width = effBorderRect.width;
                 float height = effBorderRect.height;
                 boolean[] b = new boolean[] {
-                    (bpsBefore != null), (bpsEnd != null), 
+                    (bpsBefore != null), (bpsEnd != null),
                     (bpsAfter != null), (bpsStart != null)};
                 if (!b[0] && !b[1] && !b[2] && !b[3]) {
                     return;
@@ -1385,9 +1385,9 @@
                     (b[2] ? bpsAfter.width / 1000f : 0.0f),
                     (b[3] ? bpsStart.width / 1000f : 0.0f)};
                 float[] clipw = new float[] {
-                    BorderProps.getClippedWidth(bpsBefore) / 1000f,    
-                    BorderProps.getClippedWidth(bpsEnd) / 1000f,    
-                    BorderProps.getClippedWidth(bpsAfter) / 1000f,    
+                    BorderProps.getClippedWidth(bpsBefore) / 1000f,
+                    BorderProps.getClippedWidth(bpsEnd) / 1000f,
+                    BorderProps.getClippedWidth(bpsAfter) / 1000f,
                     BorderProps.getClippedWidth(bpsStart) / 1000f};
                 starty += clipw[0];
                 height -= clipw[0];
@@ -1395,7 +1395,7 @@
                 startx += clipw[3];
                 width -= clipw[3];
                 width -= clipw[1];
-                
+
                 boolean[] slant = new boolean[] {
                     (b[3] && b[0]), (b[0] && b[1]), (b[1] && b[2]), (b[2] && b[3])};
                 if (bpsBefore != null) {
@@ -1433,7 +1433,7 @@
                     currentPath = null;
                     Rectangle2D.Float lineRect = new Rectangle2D.Float(
                             sx1a, outery, ex1a - sx1a, innery - outery);
-                    Java2DRenderer.drawBorderLine(lineRect, true, true, 
+                    Java2DRenderer.drawBorderLine(lineRect, true, true,
                             bpsBefore.style, bpsBefore.color, g);
                     //restoreGraphicsState();
                 }
@@ -1447,7 +1447,7 @@
                     float outerx = startx + width + clipw[1];
                     float clipx = outerx - clipw[1];
                     float innerx = outerx - bw[1];
-                    
+
                     //saveGraphicsState();
                     Graphics2D g = (Graphics2D)g2d.create();
                     moveTo(clipx, sy1);
@@ -1472,7 +1472,7 @@
                     currentPath = null;
                     Rectangle2D.Float lineRect = new Rectangle2D.Float(
                             innerx, sy1a, outerx - innerx, ey1a - sy1a);
-                    Java2DRenderer.drawBorderLine(lineRect, false, false, 
+                    Java2DRenderer.drawBorderLine(lineRect, false, false,
                             bpsEnd.style, bpsEnd.color, g);
                     //restoreGraphicsState();
                 }
@@ -1511,7 +1511,7 @@
                     currentPath = null;
                     Rectangle2D.Float lineRect = new Rectangle2D.Float(
                             sx1a, innery, ex1a - sx1a, outery - innery);
-                    Java2DRenderer.drawBorderLine(lineRect, true, false, 
+                    Java2DRenderer.drawBorderLine(lineRect, true, false,
                             bpsAfter.style, bpsAfter.color, g);
                     //restoreGraphicsState();
                 }
@@ -1550,7 +1550,7 @@
                     currentPath = null;
                     Rectangle2D.Float lineRect = new Rectangle2D.Float(
                             outerx, sy1a, innerx - outerx, ey1a - sy1a);
-                    Java2DRenderer.drawBorderLine(lineRect, false, false, 
+                    Java2DRenderer.drawBorderLine(lineRect, false, false,
                             bpsStart.style, bpsStart.color, g);
                     //restoreGraphicsState();
                 }
@@ -1559,10 +1559,10 @@
             public Dimension getImageSize() {
                 return paintRect.getSize();
             }
-            
+
         };
         try {
-            g2a.paintImage(painter, rc, 
+            g2a.paintImage(painter, rc,
                     paintRect.x - xoffset, paintRect.y, paintRect.width, paintRect.height);
         } catch (IOException ioe) {
             handleIOTrouble(ioe);
@@ -1577,7 +1577,7 @@
     public void setAllTextAsBitmaps(boolean allTextAsBitmaps) {
         this.allTextAsBitmaps = allTextAsBitmaps;
     }
-    
-    
-    
+
+
+
 }

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java?rev=655445&r1=655444&r2=655445&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java Mon May 12 01:58:21 2008
@@ -16,7 +16,7 @@
  */
 
 /* $Id$ */
- 
+
 package org.apache.fop.render.ps;
 
 
@@ -91,28 +91,28 @@
      * @exception TranscoderException if an error occured while transcoding
      */
     protected void transcode(Document document, String uri,
-                             TranscoderOutput output) 
+                             TranscoderOutput output)
         throws TranscoderException {
 
         graphics = createDocumentGraphics2D();
         if (!isTextStroked()) {
-            FontInfo fontInfo = new FontInfo();   
-            //TODO Do custom font configuration here somewhere/somehow 
-            FontSetup.setup(fontInfo);   
+            FontInfo fontInfo = new FontInfo();
+            //TODO Do custom font configuration here somewhere/somehow
+            FontSetup.setup(fontInfo);
             graphics.setCustomTextHandler(new NativeTextHandler(graphics, fontInfo));
         }
 
         super.transcode(document, uri, output);
 
         getLogger().trace("document size: " + width + " x " + height);
-        
+
         // prepare the image to be painted
-        UnitProcessor.Context uctx = UnitProcessor.createContext(ctx, 
+        UnitProcessor.Context uctx = UnitProcessor.createContext(ctx,
                     document.getDocumentElement());
-        float widthInPt = UnitProcessor.userSpaceToSVG(width, SVGLength.SVG_LENGTHTYPE_PT, 
+        float widthInPt = UnitProcessor.userSpaceToSVG(width, SVGLength.SVG_LENGTHTYPE_PT,
                     UnitProcessor.HORIZONTAL_LENGTH, uctx);
         int w = (int)(widthInPt + 0.5);
-        float heightInPt = UnitProcessor.userSpaceToSVG(height, SVGLength.SVG_LENGTHTYPE_PT, 
+        float heightInPt = UnitProcessor.userSpaceToSVG(height, SVGLength.SVG_LENGTHTYPE_PT,
                 UnitProcessor.HORIZONTAL_LENGTH, uctx);
         int h = (int)(heightInPt + 0.5);
         getLogger().trace("document size: " + w + "pt x " + h + "pt");
@@ -140,7 +140,7 @@
             throw new TranscoderException(ex);
         }
     }
-    
+
     /** {@inheritDoc} */
     protected BridgeContext createBridgeContext() {
 
@@ -148,7 +148,7 @@
         if (!isTextStroked()) {
             TextHandler handler = graphics.getCustomTextHandler();
             if (handler instanceof NativeTextHandler) {
-                NativeTextHandler nativeTextHandler = (NativeTextHandler)handler; 
+                NativeTextHandler nativeTextHandler = (NativeTextHandler)handler;
                 PSTextPainter textPainter = new PSTextPainter(nativeTextHandler);
                 ctx.setTextPainter(textPainter);
                 ctx.putBridge(new PSTextElementBridge(textPainter));

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/NativeTextHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/NativeTextHandler.java?rev=655445&r1=655444&r2=655445&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/NativeTextHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/NativeTextHandler.java Mon May 12 01:58:21 2008
@@ -38,16 +38,16 @@
 public class NativeTextHandler implements PSTextHandler {
 
     private PSGraphics2D g2d;
-    
+
     /** FontInfo containing all available fonts */
     protected FontInfo fontInfo;
 
     /** Currently valid Font */
     protected Font font;
-    
+
     /** Overriding FontState */
     protected Font overrideFont = null;
-    
+
     /** the current (internal) font name */
     protected String currentFontName;
 
@@ -67,13 +67,13 @@
             setupFontInfo();
         }
     }
-    
+
     private void setupFontInfo() {
         //Sets up a FontInfo with default fonts
         fontInfo = new FontInfo();
         FontSetup.setup(fontInfo);
     }
-    
+
     /**
      * Return the font information associated with this object
      * @return the FontInfo object
@@ -85,7 +85,7 @@
     private PSGenerator getPSGenerator() {
         return this.g2d.getPSGenerator();
     }
-    
+
     /** {@inheritDoc} */
     public void writeSetup() throws IOException {
         if (fontInfo != null) {
@@ -99,9 +99,9 @@
     }
 
     /**
-     * Draw a string to the PostScript document. The text is painted using 
+     * Draw a string to the PostScript document. The text is painted using
      * text operations.
-     * {@inheritDoc} 
+     * {@inheritDoc}
      */
     public void drawString(String s, float x, float y) throws IOException {
         g2d.preparePainting();
@@ -112,7 +112,7 @@
             this.font = this.overrideFont;
             this.overrideFont = null;
         }
-        
+
         //Color and Font state
         g2d.establishColor(g2d.getColor());
         establishCurrentFont();
@@ -130,14 +130,14 @@
         gen.writeln(gen.formatDouble(x) + " "
                   + gen.formatDouble(y) + " moveto ");
         gen.writeln("1 -1 scale");
-  
+
         StringBuffer sb = new StringBuffer("(");
         escapeText(s, sb);
         sb.append(") t ");
 
         gen.writeln(sb.toString());
-        
-        gen.restoreGraphicsState();        
+
+        gen.restoreGraphicsState();
     }
 
     private void escapeText(final String text, StringBuffer target) {
@@ -157,7 +157,7 @@
         int fontSize = 1000 * f.getSize();
         String style = f.isItalic() ? "italic" : "normal";
         int weight = f.isBold() ? Font.WEIGHT_BOLD : Font.WEIGHT_NORMAL;
-                
+
         FontTriplet triplet = fontInfo.findAdjustWeight(fontFamily, style, weight);
         if (triplet == null) {
             triplet = fontInfo.findAdjustWeight("sans-serif", style, weight);
@@ -166,10 +166,10 @@
     }
 
     private void establishCurrentFont() throws IOException {
-        if ((currentFontName != this.font.getFontName()) 
+        if ((currentFontName != this.font.getFontName())
                 || (currentFontSize != this.font.getFontSize())) {
             PSGenerator gen = getPSGenerator();
-            gen.writeln(this.font.getFontName() + " " 
+            gen.writeln(this.font.getFontName() + " "
                     + gen.formatDouble(font.getFontSize() / 1000f) + " F");
             currentFontName = this.font.getFontName();
             currentFontSize = this.font.getFontSize();
@@ -183,6 +183,6 @@
     public void setOverrideFont(Font override) {
         this.overrideFont = override;
     }
-    
+
 
 }

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java?rev=655445&r1=655444&r2=655445&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java Mon May 12 01:58:21 2008
@@ -56,7 +56,7 @@
 
     private int width;
     private int height;
-    
+
     //for SVG scaling
     private float svgWidth;
     private float svgHeight;
@@ -65,7 +65,7 @@
     public static final int NORMAL_PDF_RESOLUTION = 72;
     /** Default device resolution (300dpi is a resonable quality for most purposes) */
     public static final int DEFAULT_NATIVE_DPI = 300;
-  
+
     /**
      * The device resolution may be different from the normal target resolution. See
      * http://issues.apache.org/bugzilla/show_bug.cgi?id=37305
@@ -96,7 +96,7 @@
     public PDFDocumentGraphics2D(boolean textAsShapes) {
         super(textAsShapes);
 
-        this.pdfDoc = new PDFDocument("Apache FOP Version " + Version.getVersion() 
+        this.pdfDoc = new PDFDocument("Apache FOP Version " + Version.getVersion()
                 + ": PDFDocumentGraphics2D");
         this.pdfContext = new PDFContext();
     }
@@ -150,7 +150,7 @@
     }
 
     /**
-     * Setup a default FontInfo instance if none has been setup before. 
+     * Setup a default FontInfo instance if none has been setup before.
      */
     public void setupDefaultFontInfo() {
         if (fontInfo == null) {
@@ -160,7 +160,7 @@
             setFontInfo(fontInfo);
         }
     }
-    
+
     /**
      * Set the device resolution for rendering.  Will take effect at the
      * start of the next page.
@@ -184,7 +184,7 @@
     public void setFontInfo(FontInfo fontInfo) {
         this.fontInfo = fontInfo;
     }
-    
+
     /**
      * Get the font info for this pdf document.
      * @return the font information
@@ -208,7 +208,7 @@
     public PDFContext getPDFContext() {
         return this.pdfContext;
     }
-    
+
     /**
      * Set the dimensions of the svg document that will be drawn.
      * This is useful if the dimensions of the svg document are different
@@ -248,9 +248,9 @@
     public void nextPage() {
         closePage();
     }
-    
+
     /**
-     * Closes the current page and adds it to the PDF file. 
+     * Closes the current page and adds it to the PDF file.
      */
     protected void closePage() {
         if (!pdfContext.isPagePending()) {
@@ -270,7 +270,7 @@
         this.pdfDoc.addObject(pdfContext.getCurrentPage());
         pdfContext.clearCurrentPage();
     }
-    
+
     /** {@inheritDoc} */
     protected void preparePainting() {
         if (pdfContext.isPagePending()) {
@@ -300,7 +300,7 @@
         if (this.initialTransform == null) {
             //Save initial transformation matrix
             this.initialTransform = getTransform();
-            this.initialClip = getClip();      
+            this.initialClip = getClip();
         } else {
             //Reset transformation matrix
             setTransform(this.initialTransform);
@@ -313,7 +313,7 @@
         if (currentStream == null) {
             currentStream = new StringWriter();
         }
-        
+
         PDFResources pdfResources = this.pdfDoc.getResources();
         PDFPage page = this.pdfDoc.getFactory().makePage(pdfResources,
                 width, height);
@@ -321,7 +321,7 @@
         pdfContext.setCurrentPage(page);
         pageRef = page.referencePDF();
 
-        AffineTransform at = new AffineTransform(1.0, 0.0, 0.0, -1.0, 
+        AffineTransform at = new AffineTransform(1.0, 0.0, 0.0, -1.0,
                                                  0.0, (double)height);
         currentStream.write("1 0 0 -1 0 " + height + " cm\n");
         if (svgWidth != 0) {
@@ -336,7 +336,7 @@
             at.scale(s, s);
             currentStream.write("" + PDFNumber.doubleOut(s) + " 0 0 "
                                 + PDFNumber.doubleOut(s) + " 0 0 cm\n");
-            
+
             scale(1 / s, 1 / s);
         }
         // Remember the transform we installed.
@@ -344,8 +344,8 @@
 
         pdfContext.increasePageCount();
     }
-        
-    
+
+
     /**
      * The rendering process has finished.
      * This should be called after the rendering has completed as there is

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java?rev=655445&r1=655444&r2=655445&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java Mon May 12 01:58:21 2008
@@ -44,23 +44,23 @@
      * @param cfg the configuration
      * @throws ConfigurationException if an error occurs while configuring the object
      */
-    public void configure(PDFDocumentGraphics2D graphics, Configuration cfg) 
+    public void configure(PDFDocumentGraphics2D graphics, Configuration cfg)
             throws ConfigurationException {
         PDFDocument pdfDoc = graphics.getPDFDocument();
-        
+
         //Filter map
         pdfDoc.setFilterMap(
                 PDFRendererConfigurator.buildFilterMapFromConfiguration(cfg));
-        
+
         //Fonts
         try {
             FontResolver fontResolver = FontManager.createMinimalFontResolver();
             //TODO The following could be optimized by retaining the FontManager somewhere
             FontManager fontManager = new FontManager();
-            
+
             //TODO Make use of fontBaseURL, font substitution and referencing configuration
             //Requires a change to the expected configuration layout
-            
+
             List/*<EmbedFontInfo>*/ embedFontInfoList
                 = PrintRendererConfigurator.buildFontListFromConfiguration(
                     cfg, fontResolver, false, fontManager);
@@ -74,5 +74,5 @@
             throw new ConfigurationException("Error while setting up fonts", e);
         }
     }
-    
+
 }

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/svg/PDFGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/svg/PDFGraphics2D.java?rev=655445&r1=655444&r2=655445&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/svg/PDFGraphics2D.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/svg/PDFGraphics2D.java Mon May 12 01:58:21 2008
@@ -106,13 +106,13 @@
 public class PDFGraphics2D extends AbstractGraphics2D {
 
     private static final AffineTransform IDENTITY_TRANSFORM = new AffineTransform();
-    
-    /** The number of decimal places. */ 
+
+    /** The number of decimal places. */
     private static final int DEC = 8;
 
     /** Convenience constant for full opacity */
     static final int OPAQUE = 255;
-    
+
     /**
      * the PDF Document being created
      */
@@ -308,7 +308,7 @@
     public String getPageReference() {
         return this.pageRef;
     }
-    
+
     /**
      * Set the Graphics context.
      * @param c the graphics context to use
@@ -319,10 +319,10 @@
     }
 
     private void setPrivateHints() {
-        setRenderingHint(RenderingHintsKeyExt.KEY_AVOID_TILE_PAINTING, 
+        setRenderingHint(RenderingHintsKeyExt.KEY_AVOID_TILE_PAINTING,
                 RenderingHintsKeyExt.VALUE_AVOID_TILE_PAINTING_ON);
     }
-    
+
     /**
      * Set the override font state for drawing text.
      * This is used by the PDF text painter so that it can temporarily
@@ -362,7 +362,7 @@
             concatMatrix(matrix);
         }
     }
-    
+
     /**
      * This is mainly used for shading patterns which use the document-global coordinate system
      * instead of the local one.
@@ -372,7 +372,7 @@
         AffineTransform at = new AffineTransform(graphicsState.getTransform());
         return at;
     }
-    
+
     /**
      * This is a pdf specific method used to add a link to the
      * pdf document.
@@ -417,7 +417,7 @@
      * @param width the width to draw the image
      * @param height the height to draw the image
      */
-    void addNativeImage(org.apache.xmlgraphics.image.loader.Image image, float x, float y, 
+    void addNativeImage(org.apache.xmlgraphics.image.loader.Image image, float x, float y,
                              float width, float height) {
         preparePainting();
         String key = image.getInfo().getOriginalURI();
@@ -425,10 +425,10 @@
             // Need to include hash code as when invoked from FO you
             // may have several 'independent' PDFGraphics2D so the
             // count is not enough.
-            key = "__AddNative_" + hashCode() + "_" + nativeCount; 
+            key = "__AddNative_" + hashCode() + "_" + nativeCount;
             nativeCount++;
         }
-        
+
         PDFImage pdfImage;
         if (image instanceof ImageRawJPEG) {
             pdfImage = new ImageRawJPEGAdapter((ImageRawJPEG)image, key);
@@ -438,7 +438,7 @@
             throw new IllegalArgumentException(
                     "Unsupported Image subclass: " + image.getClass().getName());
         }
-        
+
         PDFXObject xObject = this.pdfDoc.addImage(resourceContext, pdfImage);
         if (outputStream != null) {
             try {
@@ -649,7 +649,7 @@
             graphicsState.pop();
         }
     }
-    
+
 /*
     // in theory we could set the clip using these methods
     // it doesn't seem to improve the file sizes much
@@ -784,8 +784,8 @@
                     (float) gpaint.getPoint1().getX(),
                     (float) gpaint.getPoint1().getY(),
                     (float) gpaint.getPoint2().getX(),
-                    (float) gpaint.getPoint2().getY(), 
-                    new float[] {0, 1}, 
+                    (float) gpaint.getPoint2().getY(),
+                    new float[] {0, 1},
                     new Color[] {gpaint.getColor1(), gpaint.getColor2()},
                     gpaint.isCyclic() ? LinearGradientPaint.REPEAT : LinearGradientPaint.NO_CYCLE);
         }
@@ -927,7 +927,7 @@
                     return false;  // PDF can't do alpha
                 }
 
-                someColors.add(new PDFColor(cc.getRed(), cc.getGreen(), 
+                someColors.add(new PDFColor(cc.getRed(), cc.getGreen(),
                                             cc.getBlue()));
             }
 
@@ -947,7 +947,7 @@
             currentStream.write(myPat.getColorSpaceOut(fill));
 
             return true;
-        } 
+        }
         if (paint instanceof PatternPaint) {
             PatternPaint pp = (PatternPaint)paint;
             return createPattern(pp, fill);
@@ -990,14 +990,14 @@
         //     double patMaxX = rect.getX() + rect.getWidth();
         //     double patMaxY = rect.getY() + rect.getHeight();
         //     double stepX = rect.getWidth();
-        //     double stepY = rect.getHeight();            
-        // 
+        //     double stepY = rect.getHeight();
+        //
         //     int startX = (int)((rect.getX() - gnMaxX)/stepX);
         //     int startY = (int)((rect.getY() - gnMaxY)/stepY);
-        // 
+        //
         //     int endX   = (int)((patMaxX - gnMinX)/stepX);
         //     int endY   = (int)((patMaxY - gnMinY)/stepY);
-        // 
+        //
         //     pattGraphic.translate(startX*stepX, startY*stepY);
         //     for (int yIdx=startY; yIdx<=endY; yIdx++) {
         //         for (int xIdx=startX; xIdx<=endX; xIdx++) {
@@ -1027,14 +1027,14 @@
         }
 
         /** @todo see if pdfDoc and res can be linked here,
-        (currently res <> PDFDocument's resources) so addFonts() 
+        (currently res <> PDFDocument's resources) so addFonts()
         can be moved to PDFDocument class */
         res.addFonts(pdfDoc, specialFontInfo);
 
         PDFPattern myPat = pdfDoc.getFactory().makePattern(
                                 resourceContext, 1, res, 1, 1, bbox,
                                 rect.getWidth(), rect.getHeight(),
-                                theMatrix, null, 
+                                theMatrix, null,
                                 pattGraphic.getBuffer());
 
         currentStream.write(myPat.getColorSpaceOut(fill));
@@ -1094,7 +1094,7 @@
             (rgbCS, 32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000,
              false, DataBuffer.TYPE_BYTE);
 
-        PaintContext pctx = paint.createContext(rgbCM, devBounds, usrBounds, 
+        PaintContext pctx = paint.createContext(rgbCM, devBounds, usrBounds,
                                                 at, getRenderingHints());
         PDFXObject imageInfo = pdfDoc.getXObject
             ("TempImage:" + pctx.toString());
@@ -1112,7 +1112,7 @@
             final int[]  line = new int[devW];
             final byte[] mask;
             int x, y, val, rgbIdx = 0;
-        
+
             if (pcm.hasAlpha()) {
                 mask = new byte[devW * devH];
                 int maskIdx = 0;
@@ -1611,7 +1611,7 @@
                 return;
             }
         }
-        
+
         AffineTransform trans = getTransform();
         double[] tranvals = new double[6];
         trans.getMatrix(tranvals);
@@ -1709,7 +1709,7 @@
             iter.next();
         }
     }
-    
+
     /**
      * Do the PDF drawing command.
      * This does the PDF drawing command according to fill

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml?rev=655445&r1=655444&r2=655445&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml Mon May 12 01:58:21 2008
@@ -60,6 +60,14 @@
       <action context="Renderers" dev="AC" importance="high" type="add">
         Added de-duplication and externalization support for IOCA and GOCA data resource objects.
       </action -->
+      <action context="Layout" dev="MB" type="add">
+        Support character-by-character font-selection strategy on fo:character element.
+      </action>
+      <action context="Layout" dev="AD" type="fix" fixes-bug="44794">
+        Added support for page-number-citation and page-number-citation-last 
+        of fo:inline. Corrected behavior for page-number-citation-last
+        of fo:block: forward references now properly resolved.
+      </action>
       <action context="Fonts" dev="JM" type="add">
         For auto-detected fonts it is now possible to specify that a font needs to be referenced
         rather than embedded (for the output formats that support this distinction).

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/fotree/testcases/demo-test-success.fo
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/fotree/testcases/demo-test-success.fo?rev=655445&r1=655444&r2=655445&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/fotree/testcases/demo-test-success.fo (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/fotree/testcases/demo-test-success.fo Mon May 12 01:58:21 2008
@@ -8,7 +8,7 @@
   <fo:page-sequence master-reference="simpleA4">
     <fo:flow flow-name="xsl-region-body">
       <fo:block>Hello World!
-        <test:assert property="font-family" expected="[sans-serif]"/>
+        <test:assert property="font-family" expected="[sans-serif, Symbol, ZapfDingbats]"/>
         <test:assert property="font-size" expected="12000mpt"/>
       </fo:block>
       <fo:block font-family="ZapfDingbats">&#2702;</fo:block>

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/fotree/testcases/no_namespace_prefix.fo
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/fotree/testcases/no_namespace_prefix.fo?rev=655445&r1=655444&r2=655445&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/fotree/testcases/no_namespace_prefix.fo (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/fotree/testcases/no_namespace_prefix.fo Mon May 12 01:58:21 2008
@@ -26,7 +26,7 @@
   <page-sequence master-reference="A4">
     <flow flow-name="xsl-region-body">
       <block>Hello World!
-        <test:assert property="font-family" expected="[sans-serif]"/>
+        <test:assert property="font-family" expected="[sans-serif, Symbol, ZapfDingbats]"/>
         <test:assert property="font-size" expected="12000mpt"/>
       </block>
     </flow>

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/config/BaseUserConfigTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/config/BaseUserConfigTestCase.java?rev=655445&r1=655444&r2=655445&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/config/BaseUserConfigTestCase.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/config/BaseUserConfigTestCase.java Mon May 12 01:58:21 2008
@@ -33,7 +33,7 @@
 import org.xml.sax.SAXException;
 
 /**
- * Basic runtime test for FOP's font configuration. It is used to verify that 
+ * Basic runtime test for FOP's font configuration. It is used to verify that
  * nothing obvious is broken after compiling.
  */
 public abstract class BaseUserConfigTestCase extends BasePDFTestCase {
@@ -59,7 +59,7 @@
     }
 
     protected void initConfig() throws Exception {
-        fopFactory.setUserConfig(getUserConfig());                
+        fopFactory.setUserConfig(getUserConfig());
     }
 
     protected void convertFO() throws Exception {
@@ -70,7 +70,7 @@
         FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
         convertFO(foFile, foUserAgent, dumpOutput);
     }
-    
+
     /**
      * get test FOP config File
      * @return fo test filepath
@@ -82,9 +82,9 @@
     /**
      * get test FOP Configuration
      * @return fo test filepath
-     * @throws IOException 
-     * @throws SAXException 
-     * @throws ConfigurationException 
+     * @throws IOException
+     * @throws SAXException
+     * @throws ConfigurationException
      */
     protected Configuration getUserConfig(String configString) throws ConfigurationException, SAXException, IOException {
         return cfgBuilder.build(new ByteArrayInputStream(configString.getBytes()));
@@ -114,11 +114,11 @@
     /**
      * get test FOP Configuration
      * @return fo test filepath
-     * @throws IOException 
-     * @throws SAXException 
-     * @throws ConfigurationException 
+     * @throws IOException
+     * @throws SAXException
+     * @throws ConfigurationException
      */
     protected Configuration getUserConfig() throws ConfigurationException, SAXException, IOException {
         return cfgBuilder.buildFromFile(getUserConfigFile());
-    }        
+    }
 }

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/config/FontsSubstitutionTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/config/FontsSubstitutionTestCase.java?rev=655445&r1=655444&r2=655445&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/config/FontsSubstitutionTestCase.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/config/FontsSubstitutionTestCase.java Mon May 12 01:58:21 2008
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-/* $Id: $ */
+/* $Id$ */
 
 package org.apache.fop.config;
 
@@ -29,8 +29,16 @@
 import org.apache.fop.fonts.FontTriplet;
 import org.apache.fop.render.PrintRenderer;
 
-public class FontsSubstitutionTestCase extends BaseConstructiveUserConfigTestCase {
+/**
+ * Tests the font substitution mechanism
+ */
+public class FontsSubstitutionTestCase extends
+        BaseConstructiveUserConfigTestCase {
 
+    /**
+     * Main constructor
+     * @param name test case name
+     */
     public FontsSubstitutionTestCase(String name) {
         super(name);
     }
@@ -38,13 +46,16 @@
     /**
      * {@inheritDoc}
      */
-    protected byte[] convertFO(File foFile, FOUserAgent ua, boolean dumpPdfFile) throws Exception {
-        PrintRenderer renderer = (PrintRenderer)ua.getRendererFactory().createRenderer(ua, MimeConstants.MIME_PDF);
+    protected byte[] convertFO(File foFile, FOUserAgent ua, boolean dumpPdfFile)
+            throws Exception {
+        PrintRenderer renderer = (PrintRenderer) ua.getRendererFactory()
+                .createRenderer(ua, MimeConstants.MIME_PDF);
         FontInfo fontInfo = new FontInfo();
         renderer.setupFontInfo(fontInfo);
         FontManager fontManager = ua.getFactory().getFontManager();
         fontManager.setupRenderer(renderer);
-        FontTriplet triplet = new FontTriplet("Times", "italic", Font.WEIGHT_NORMAL);
+        FontTriplet triplet = new FontTriplet("Times", "italic",
+                Font.WEIGHT_NORMAL);
         String internalFontKey = fontInfo.getInternalFontKey(triplet);
         // Times italic should now be mapped to the 15th font (custom font)
         // not the original base 14 (F6)

Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/config/FontsSubstitutionTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/config/FontsSubstitutionTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Id



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