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/07/02 15:23:52 UTC

svn commit: r1356212 [2/2] - in /xmlgraphics/fop/branches/Temp_URI_Unification: ./ examples/fo/ examples/fo/advanced/ examples/fo/basic/ examples/fo/svg/ examples/fo/tables/ src/documentation/content/xdocs/ src/documentation/content/xdocs/fo/ src/java/...

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pcl/PCLPainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pcl/PCLPainter.java?rev=1356212&r1=1356211&r2=1356212&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pcl/PCLPainter.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pcl/PCLPainter.java Mon Jul  2 13:23:46 2012
@@ -47,7 +47,6 @@ import org.apache.fop.fonts.FontTriplet;
 import org.apache.fop.render.ImageHandlerUtil;
 import org.apache.fop.render.RenderingContext;
 import org.apache.fop.render.intermediate.AbstractIFPainter;
-import org.apache.fop.render.intermediate.IFContext;
 import org.apache.fop.render.intermediate.IFException;
 import org.apache.fop.render.intermediate.IFState;
 import org.apache.fop.render.intermediate.IFUtil;
@@ -58,15 +57,12 @@ import org.apache.fop.traits.RuleStyle;
 import org.apache.fop.util.CharUtilities;
 
 /**
- * {@link org.apache.fop.render.intermediate.IFPainter} implementation
- * that produces PCL 5.
+ * {@link org.apache.fop.render.intermediate.IFPainter} implementation that produces PCL 5.
  */
-public class PCLPainter extends AbstractIFPainter implements PCLConstants {
+public class PCLPainter extends AbstractIFPainter<PCLDocumentHandler> implements PCLConstants {
 
     private static final boolean DEBUG = false;
 
-    private PCLDocumentHandler parent;
-
     /** The PCL generator */
     private PCLGenerator gen;
 
@@ -74,7 +70,7 @@ public class PCLPainter extends Abstract
     private int currentPrintDirection = 0;
     //private GeneralPath currentPath = null;
 
-    private Stack graphicContextStack = new Stack();
+    private Stack<GraphicContext> graphicContextStack = new Stack<GraphicContext>();
     private GraphicContext graphicContext = new GraphicContext();
 
     /**
@@ -83,24 +79,19 @@ public class PCLPainter extends Abstract
      * @param pageDefinition the page definition describing the page to be rendered
      */
     public PCLPainter(PCLDocumentHandler parent, PCLPageDefinition pageDefinition) {
-        this.parent = parent;
+        super(parent);
         this.gen = parent.getPCLGenerator();
         this.state = IFState.create();
         this.currentPageDefinition = pageDefinition;
     }
 
-    /** {@inheritDoc} */
-    public IFContext getContext() {
-        return this.parent.getContext();
-    }
-
     PCLRenderingUtil getPCLUtil() {
-        return this.parent.getPCLUtil();
+        return getDocumentHandler().getPCLUtil();
     }
 
     /** @return the target resolution */
     protected int getResolution() {
-        int resolution = (int)Math.round(getUserAgent().getTargetResolution());
+        int resolution = Math.round(getUserAgent().getTargetResolution());
         if (resolution <= 300) {
             return 300;
         } else {
@@ -223,7 +214,7 @@ public class PCLPainter extends Abstract
                     g2d.translate(-rect.x, -rect.y);
 
                     Java2DPainter painter = new Java2DPainter(g2d,
-                            getContext(), parent.getFontInfo(), state);
+                            getContext(), getFontInfo(), state);
                     try {
                         painter.drawBorderRect(rect, top, bottom, left, right);
                     } catch (IFException e) {
@@ -258,7 +249,7 @@ public class PCLPainter extends Abstract
                 g2d.translate(-boundingBox.x, -boundingBox.y);
 
                 Java2DPainter painter = new Java2DPainter(g2d,
-                        getContext(), parent.getFontInfo(), state);
+                        getContext(), getFontInfo(), state);
                 try {
                     painter.drawLine(start, end, width, color, style);
                 } catch (IFException e) {
@@ -315,9 +306,8 @@ public class PCLPainter extends Abstract
                     state.getFontFamily(), state.getFontStyle(), state.getFontWeight());
             //TODO Ignored: state.getFontVariant()
             //TODO Opportunity for font caching if font state is more heavily used
-            String fontKey = parent.getFontInfo().getInternalFontKey(triplet);
-            boolean pclFont = getPCLUtil().isAllTextAsBitmaps()
-                        ? false
+            String fontKey = getFontKey(triplet);
+            boolean pclFont = getPCLUtil().isAllTextAsBitmaps() ? false
                         : HardcodedFonts.setFont(gen, fontKey, state.getFontSize(), text);
             if (pclFont) {
                 drawTextNative(x, y, letterSpacing, wordSpacing, dp, text, triplet);
@@ -346,7 +336,7 @@ public class PCLPainter extends Abstract
         setCursorPos(x, y);
 
         float fontSize = state.getFontSize() / 1000f;
-        Font font = parent.getFontInfo().getFontInstance(triplet, state.getFontSize());
+        Font font = getFontInfo().getFontInstance(triplet, state.getFontSize());
         int l = text.length();
         int[] dx = IFUtil.convertDPToDX ( dp );
         int dxl = (dx != null ? dx.length : 0);
@@ -438,13 +428,12 @@ public class PCLPainter extends Abstract
             final int letterSpacing, final int wordSpacing, final int[][] dp,
             final String text, FontTriplet triplet) throws IFException {
         //Use Java2D to paint different fonts via bitmap
-        final Font font = parent.getFontInfo().getFontInstance(triplet, state.getFontSize());
+        final Font font = getFontInfo().getFontInstance(triplet, state.getFontSize());
 
         //for cursive fonts, so the text isn't clipped
         FontMetricsMapper mapper;
         try {
-        mapper = (FontMetricsMapper)parent.getFontInfo().getMetricsFor(
-                font.getFontName());
+            mapper = (FontMetricsMapper) getFontInfo().getMetricsFor(font.getFontName());
         } catch (Exception t) {
             throw new RuntimeException(t);
         }
@@ -475,8 +464,7 @@ public class PCLPainter extends Abstract
                     rect = new Rectangle(x, y, 1000, -descent);
                     g2d.draw(rect);
                 }
-                Java2DPainter painter = new Java2DPainter(g2d,
-                        getContext(), parent.getFontInfo(), state);
+                Java2DPainter painter = new Java2DPainter(g2d, getContext(), getFontInfo(), state);
                 try {
                     painter.drawText(x, y, letterSpacing, wordSpacing, dp, text);
                 } catch (IFException e) {
@@ -501,7 +489,7 @@ public class PCLPainter extends Abstract
 
     /** Restores the last graphics state from the stack. */
     private void restoreGraphicsState() {
-        graphicContext = (GraphicContext)graphicContextStack.pop();
+        graphicContext = graphicContextStack.pop();
     }
 
     private void concatenateTransformationMatrix(AffineTransform transform) throws IOException {

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=1356212&r1=1356211&r2=1356212&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 Mon Jul  2 13:23:46 2012
@@ -40,7 +40,6 @@ import org.apache.fop.fo.extensions.xmp.
 import org.apache.fop.pdf.PDFAnnotList;
 import org.apache.fop.pdf.PDFDocument;
 import org.apache.fop.pdf.PDFPage;
-import org.apache.fop.pdf.PDFResourceContext;
 import org.apache.fop.pdf.PDFResources;
 import org.apache.fop.render.extensions.prepress.PageBoundaries;
 import org.apache.fop.render.extensions.prepress.PageScale;
@@ -68,31 +67,28 @@ public class PDFDocumentHandler extends 
     private PDFStructureTreeBuilder structureTreeBuilder;
 
     /** the PDF Document being created */
-    protected PDFDocument pdfDoc;
+    private PDFDocument pdfDoc;
 
     /**
      * Utility class which enables all sorts of features that are not directly connected to the
      * normal rendering process.
      */
-    protected final PDFRenderingUtil pdfUtil;
+    private final PDFRenderingUtil pdfUtil;
 
     /** the /Resources object of the PDF document being created */
-    protected PDFResources pdfResources;
+    private PDFResources pdfResources;
 
     /** The current content generator */
-    protected PDFContentGenerator generator;
-
-    /** the current annotation list to add annotations to */
-    protected PDFResourceContext currentContext;
+    private PDFContentGenerator generator;
 
     /** the current page to add annotations to */
-    protected PDFPage currentPage;
+    private PDFPage currentPage;
 
     /** the current page's PDF reference */
-    protected PageReference currentPageRef;
+    private PageReference currentPageRef;
 
     /** Used for bookmarks/outlines. */
-    protected Map<Integer, PageReference> pageReferences = new HashMap<Integer, PageReference>();
+    private Map<Integer, PageReference> pageReferences = new HashMap<Integer, PageReference>();
 
     private final PDFDocumentNavigationHandler documentNavigationHandler
             = new PDFDocumentNavigationHandler(this);
@@ -133,6 +129,22 @@ public class PDFDocumentHandler extends 
         return logicalStructureHandler;
     }
 
+    PDFDocument getPDFDocument() {
+        return pdfDoc;
+    }
+
+    PDFPage getCurrentPage() {
+        return currentPage;
+    }
+
+    PageReference getCurrentPageRef() {
+        return currentPageRef;
+    }
+
+    PDFContentGenerator getGenerator() {
+        return generator;
+    }
+
     /** {@inheritDoc} */
     public void startDocument() throws IFException {
         super.startDocument();
@@ -171,7 +183,6 @@ public class PDFDocumentHandler extends 
 
             pdfResources = null;
             this.generator = null;
-            currentContext = null;
             currentPage = null;
         } catch (IOException ioe) {
             throw new IFException("I/O error in endDocument()", ioe);

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFDocumentNavigationHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFDocumentNavigationHandler.java?rev=1356212&r1=1356211&r2=1356212&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFDocumentNavigationHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/pdf/PDFDocumentNavigationHandler.java Mon Jul  2 13:23:46 2012
@@ -63,7 +63,7 @@ public class PDFDocumentNavigationHandle
     }
 
     PDFDocument getPDFDoc() {
-        return this.documentHandler.pdfDoc;
+        return this.documentHandler.getPDFDocument();
     }
 
     /** {@inheritDoc} */
@@ -100,7 +100,7 @@ public class PDFDocumentNavigationHandle
     /** {@inheritDoc} */
     public void renderLink(Link link) throws IFException {
         Rectangle targetRect = link.getTargetRect();
-        int pageHeight = documentHandler.currentPageRef.getPageDimension().height;
+        int pageHeight = documentHandler.getCurrentPageRef().getPageDimension().height;
         Rectangle2D targetRect2D = new Rectangle2D.Double(
                 targetRect.getMinX() / 1000.0,
                 (pageHeight - targetRect.getMinY() - targetRect.getHeight()) / 1000.0,
@@ -116,7 +116,7 @@ public class PDFDocumentNavigationHandle
             if (documentHandler.getUserAgent().isAccessibilityEnabled() && structure != null) {
                 documentHandler.getLogicalStructureHandler().addLinkContentItem(pdfLink, structure);
             }
-            documentHandler.currentPage.addAnnotation(pdfLink);
+            documentHandler.getCurrentPage().addAnnotation(pdfLink);
         }
     }
 

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=1356212&r1=1356211&r2=1356212&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 Mon Jul  2 13:23:46 2012
@@ -30,19 +30,16 @@ import java.io.IOException;
 import org.w3c.dom.Document;
 
 import org.apache.fop.fonts.Font;
-import org.apache.fop.fonts.FontInfo;
 import org.apache.fop.fonts.FontTriplet;
 import org.apache.fop.fonts.LazyFont;
 import org.apache.fop.fonts.SingleByteFont;
 import org.apache.fop.fonts.Typeface;
-import org.apache.fop.pdf.PDFDocument;
 import org.apache.fop.pdf.PDFNumber;
 import org.apache.fop.pdf.PDFStructElem;
 import org.apache.fop.pdf.PDFTextUtil;
 import org.apache.fop.pdf.PDFXObject;
 import org.apache.fop.render.RenderingContext;
 import org.apache.fop.render.intermediate.AbstractIFPainter;
-import org.apache.fop.render.intermediate.IFContext;
 import org.apache.fop.render.intermediate.IFException;
 import org.apache.fop.render.intermediate.IFState;
 import org.apache.fop.render.intermediate.IFUtil;
@@ -55,9 +52,7 @@ import org.apache.fop.util.CharUtilities
 /**
  * IFPainter implementation that produces PDF.
  */
-public class PDFPainter extends AbstractIFPainter {
-
-    private final PDFDocumentHandler documentHandler;
+public class PDFPainter extends AbstractIFPainter<PDFDocumentHandler> {
 
     /** The current content generator */
     protected PDFContentGenerator generator;
@@ -77,30 +72,15 @@ public class PDFPainter extends Abstract
      */
     public PDFPainter(PDFDocumentHandler documentHandler,
             PDFLogicalStructureHandler logicalStructureHandler) {
-        super();
-        this.documentHandler = documentHandler;
+        super(documentHandler);
         this.logicalStructureHandler = logicalStructureHandler;
-        this.generator = documentHandler.generator;
+        this.generator = documentHandler.getGenerator();
         this.borderPainter = new PDFBorderPainter(this.generator);
         this.state = IFState.create();
         accessEnabled = this.getUserAgent().isAccessibilityEnabled();
     }
 
     /** {@inheritDoc} */
-    @Override
-    protected IFContext getContext() {
-        return this.documentHandler.getContext();
-    }
-
-    PDFDocument getPDFDoc() {
-        return this.documentHandler.pdfDoc;
-    }
-
-    FontInfo getFontInfo() {
-        return this.documentHandler.getFontInfo();
-    }
-
-    /** {@inheritDoc} */
     public void startViewport(AffineTransform transform, Dimension size, Rectangle clipRect)
             throws IFException {
         generator.saveGraphicsState();
@@ -129,7 +109,7 @@ public class PDFPainter extends Abstract
     /** {@inheritDoc} */
     public void drawImage(String uri, Rectangle rect)
             throws IFException {
-        PDFXObject xobject = getPDFDoc().getXObject(uri);
+        PDFXObject xobject = getDocumentHandler().getPDFDocument().getXObject(uri);
         if (xobject != null) {
             if (accessEnabled) {
                 PDFStructElem structElem = (PDFStructElem) getContext().getStructureTreeElement();
@@ -156,7 +136,7 @@ public class PDFPainter extends Abstract
     @Override
     protected RenderingContext createRenderingContext() {
         PDFRenderingContext pdfContext = new PDFRenderingContext(
-                getUserAgent(), generator, this.documentHandler.currentPage, getFontInfo());
+                getUserAgent(), generator, getDocumentHandler().getCurrentPage(), getFontInfo());
         pdfContext.setMarkedContentInfo(imageMCI);
         return pdfContext;
     }
@@ -317,12 +297,11 @@ public class PDFPainter extends Abstract
         }
     }
 
-    private void drawTextWithDX ( int x, int y, String text, FontTriplet triplet,
-                                  int letterSpacing, int wordSpacing, int[] dx ) {
-
+    private void drawTextWithDX(int x, int y, String text, FontTriplet triplet,
+            int letterSpacing, int wordSpacing, int[] dx) throws IFException {
         //TODO Ignored: state.getFontVariant()
         //TODO Opportunity for font caching if font state is more heavily used
-        String fontKey = getFontInfo().getInternalFontKey(triplet);
+        String fontKey = getFontKey(triplet);
         int sizeMillipoints = state.getFontSize();
         float fontSize = sizeMillipoints / 1000f;
 

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/ps/PSDocumentHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/ps/PSDocumentHandler.java?rev=1356212&r1=1356211&r2=1356212&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/ps/PSDocumentHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/ps/PSDocumentHandler.java Mon Jul  2 13:23:46 2012
@@ -56,6 +56,7 @@ import org.apache.fop.apps.MimeConstants
 import org.apache.fop.apps.io.TempResourceURIGenerator;
 import org.apache.fop.render.intermediate.AbstractBinaryWritingIFDocumentHandler;
 import org.apache.fop.render.intermediate.IFContext;
+import org.apache.fop.render.intermediate.IFDocumentHandler;
 import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator;
 import org.apache.fop.render.intermediate.IFException;
 import org.apache.fop.render.intermediate.IFPainter;
@@ -80,10 +81,10 @@ public class PSDocumentHandler extends A
      * Utility class which enables all sorts of features that are not directly connected to the
      * normal rendering process.
      */
-    protected PSRenderingUtil psUtil;
+    private PSRenderingUtil psUtil;
 
     /** The PostScript generator used to output the PostScript */
-    protected PSGenerator gen;
+    PSGenerator gen;
 
     /** the temporary file in case of two-pass processing */
     private URI tempURI;
@@ -134,6 +135,10 @@ public class PSDocumentHandler extends A
         return MimeConstants.MIME_POSTSCRIPT;
     }
 
+    PSGenerator getGenerator() {
+        return gen;
+    }
+
     /** {@inheritDoc} */
     public IFDocumentHandlerConfigurator getConfigurator() {
         return new PSRendererConfigurator(getUserAgent(), new PSRendererConfigParser());

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/ps/PSPainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/ps/PSPainter.java?rev=1356212&r1=1356211&r2=1356212&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/ps/PSPainter.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/render/ps/PSPainter.java Mon Jul  2 13:23:46 2012
@@ -41,7 +41,6 @@ import org.apache.xmlgraphics.ps.PSGener
 import org.apache.xmlgraphics.ps.PSResource;
 
 import org.apache.fop.fonts.Font;
-import org.apache.fop.fonts.FontInfo;
 import org.apache.fop.fonts.FontTriplet;
 import org.apache.fop.fonts.LazyFont;
 import org.apache.fop.fonts.MultiByteFont;
@@ -49,7 +48,6 @@ import org.apache.fop.fonts.SingleByteFo
 import org.apache.fop.fonts.Typeface;
 import org.apache.fop.render.RenderingContext;
 import org.apache.fop.render.intermediate.AbstractIFPainter;
-import org.apache.fop.render.intermediate.IFContext;
 import org.apache.fop.render.intermediate.IFException;
 import org.apache.fop.render.intermediate.IFState;
 import org.apache.fop.render.intermediate.IFUtil;
@@ -61,12 +59,11 @@ import org.apache.fop.util.HexEncoder;
 /**
  * IFPainter implementation that produces PostScript.
  */
-public class PSPainter extends AbstractIFPainter {
+public class PSPainter extends AbstractIFPainter<PSDocumentHandler> {
 
     /** logging instance */
     private static Log log = LogFactory.getLog(PSPainter.class);
 
-    private PSDocumentHandler documentHandler;
     private PSBorderPainter borderPainter;
 
     private boolean inTextMode = false;
@@ -80,27 +77,13 @@ public class PSPainter extends AbstractI
     }
 
     protected PSPainter(PSDocumentHandler documentHandler, IFState state) {
-        super();
-        this.documentHandler = documentHandler;
-        this.borderPainter = new PSBorderPainter(documentHandler.gen);
+        super(documentHandler);
+        this.borderPainter = new PSBorderPainter(getGenerator());
         this.state = state;
     }
 
-    /** {@inheritDoc} */
-    protected IFContext getContext() {
-        return this.documentHandler.getContext();
-    }
-
-    PSRenderingUtil getPSUtil() {
-        return this.documentHandler.psUtil;
-    }
-
-    FontInfo getFontInfo() {
-        return this.documentHandler.getFontInfo();
-    }
-
     private PSGenerator getGenerator() {
-        return this.documentHandler.gen;
+        return getDocumentHandler().getGenerator();
     }
 
     /** {@inheritDoc} */
@@ -168,7 +151,7 @@ public class PSPainter extends AbstractI
     /** {@inheritDoc} */
     protected void drawImageUsingImageHandler(ImageInfo info, Rectangle rect)
             throws ImageException, IOException {
-        if (!getPSUtil().isOptimizeResources()
+        if (!getDocumentHandler().getPSUtil().isOptimizeResources()
                 || PSImageUtils.isImageInlined(info,
                         (PSRenderingContext)createRenderingContext())) {
             super.drawImageUsingImageHandler(info, rect);
@@ -177,7 +160,7 @@ public class PSPainter extends AbstractI
                 log.debug("Image " + info + " is embedded as a form later");
             }
             //Don't load image at this time, just put a form placeholder in the stream
-            PSResource form = documentHandler.getFormForImage(info.getOriginalURI());
+            PSResource form = getDocumentHandler().getFormForImage(info.getOriginalURI());
             PSImageUtils.drawForm(form, info, rect, getGenerator());
         }
     }
@@ -246,7 +229,7 @@ public class PSPainter extends AbstractI
         if (top != null || bottom != null || left != null || right != null) {
             try {
                 endTextObject();
-                if (getPSUtil().getRenderingMode() == PSRenderingMode.SIZE
+                if (getDocumentHandler().getPSUtil().getRenderingMode() == PSRenderingMode.SIZE
                     && hasOnlySolidBorders(top, bottom, left, right)) {
                     super.drawBorderRect(rect, top, bottom, left, right);
                 } else {
@@ -273,7 +256,7 @@ public class PSPainter extends AbstractI
         if (fontName == null) {
             throw new NullPointerException("fontName must not be null");
         }
-        Typeface tf = (Typeface)getFontInfo().getFonts().get(fontName);
+        Typeface tf = getFontInfo().getFonts().get(fontName);
         if (tf instanceof LazyFont) {
             tf = ((LazyFont)tf).getRealFont();
         }
@@ -363,10 +346,7 @@ public class PSPainter extends AbstractI
                     state.getFontFamily(), state.getFontStyle(), state.getFontWeight());
             //TODO Ignored: state.getFontVariant()
             //TODO Opportunity for font caching if font state is more heavily used
-            String fontKey = getFontInfo().getInternalFontKey(triplet);
-            if (fontKey == null) {
-                throw new IFException("Font not available: " + triplet, null);
-            }
+            String fontKey = getFontKey(triplet);
             int sizeMillipoints = state.getFontSize();
 
             // This assumes that *all* CIDFonts use a /ToUnicode mapping
@@ -529,10 +509,9 @@ public class PSPainter extends AbstractI
     }
 
     private void useFont(String key, int size) throws IOException {
-        PSFontResource res = this.documentHandler.getPSResourceForFontKey(key);
+        PSFontResource res = getDocumentHandler().getPSResourceForFontKey(key);
         PSGenerator generator = getGenerator();
         generator.useFont("/" + res.getName(), size / 1000f);
         res.notifyResourceUsageOnPage(generator.getResourceTracker());
     }
-
 }

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/sandbox/org/apache/fop/render/svg/SVGPainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/sandbox/org/apache/fop/render/svg/SVGPainter.java?rev=1356212&r1=1356211&r2=1356212&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/sandbox/org/apache/fop/render/svg/SVGPainter.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/sandbox/org/apache/fop/render/svg/SVGPainter.java Mon Jul  2 13:23:46 2012
@@ -45,7 +45,6 @@ import org.apache.fop.render.ImageHandle
 import org.apache.fop.render.RenderingContext;
 import org.apache.fop.render.intermediate.AbstractIFPainter;
 import org.apache.fop.render.intermediate.IFConstants;
-import org.apache.fop.render.intermediate.IFContext;
 import org.apache.fop.render.intermediate.IFException;
 import org.apache.fop.render.intermediate.IFState;
 import org.apache.fop.render.intermediate.IFUtil;
@@ -59,12 +58,11 @@ import org.apache.fop.util.XMLUtil;
 /**
  * IFPainter implementation that writes SVG.
  */
-public class SVGPainter extends AbstractIFPainter implements SVGConstants {
-
-    private AbstractSVGDocumentHandler parent;
+public class SVGPainter extends AbstractIFPainter<AbstractSVGDocumentHandler>
+        implements SVGConstants {
 
     /** The SAX content handler that receives the generated XML events. */
-    protected GenerationHelperContentHandler handler;
+    private GenerationHelperContentHandler handler;
 
     private static final int MODE_NORMAL = 0;
     private static final int MODE_TEXT = 1;
@@ -78,18 +76,12 @@ public class SVGPainter extends Abstract
      */
     public SVGPainter(AbstractSVGDocumentHandler parent,
             GenerationHelperContentHandler contentHandler) {
-        super();
-        this.parent = parent;
+        super(parent);
         this.handler = contentHandler;
         this.state = IFState.create();
     }
 
     /** {@inheritDoc} */
-    protected IFContext getContext() {
-        return parent.getContext();
-    }
-
-    /** {@inheritDoc} */
     public void startViewport(AffineTransform transform, Dimension size, Rectangle clipRect)
             throws IFException {
         startViewport(SVGUtil.formatAffineTransformMptToPt(transform), size, clipRect);

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/status.xml?rev=1356212&r1=1356211&r2=1356212&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/status.xml (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/status.xml Mon Jul  2 13:23:46 2012
@@ -63,6 +63,9 @@
       documents. Example: the fix of marks layering will be such a case when it's done.
     -->
     <release version="FOP Trunk" date="TBD">
+      <action context="Test" dev="GA" type="fix">
+        Fix errors and warnings in example files. Add build.xml for documentation examples.
+      </action>
       <action context="Code" dev="GA" type="fix" fixes-bug="53458" due-to="Dieter von Holten">
         Fix incorrect language and country code key generation in hyphenation tree cache.
       </action>



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