]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
more FO Tree isolation work
authorWilliam Victor Mote <vmote@apache.org>
Tue, 19 Aug 2003 06:54:31 +0000 (06:54 +0000)
committerWilliam Victor Mote <vmote@apache.org>
Tue, 19 Aug 2003 06:54:31 +0000 (06:54 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196812 13f79535-47bb-0310-9956-ffa450edef68

16 files changed:
src/java/org/apache/fop/extensions/Bookmarks.java
src/java/org/apache/fop/fo/FOInputHandler.java
src/java/org/apache/fop/fo/FOTreeControl.java
src/java/org/apache/fop/fo/FOTreeHandler.java
src/java/org/apache/fop/fo/flow/Leader.java
src/java/org/apache/fop/fo/flow/PageNumber.java
src/java/org/apache/fop/fo/flow/PageNumberCitation.java
src/java/org/apache/fop/render/AbstractRenderer.java
src/java/org/apache/fop/render/PrintRenderer.java
src/java/org/apache/fop/render/Renderer.java
src/java/org/apache/fop/render/awt/AWTRenderer.java
src/java/org/apache/fop/render/pdf/FontSetup.java
src/java/org/apache/fop/render/pdf/PDFRenderer.java
src/java/org/apache/fop/render/ps/PSRenderer.java
src/java/org/apache/fop/render/svg/SVGRenderer.java
src/java/org/apache/fop/render/xml/XMLRenderer.java

index f383db27d696f3a6373e0283c4ef92e34ba77518..1326a1553ba4a611719f6cb94e2a4a84d6d3a8e3 100644 (file)
@@ -54,6 +54,7 @@ import org.apache.fop.fo.FOTreeHandler;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FOTreeVisitor;
 import org.apache.fop.area.AreaTree;
+import org.apache.fop.control.Document;
 
 import java.util.ArrayList;
 
@@ -110,7 +111,9 @@ public class Bookmarks extends ExtensionObj {
         }
         // add data to area tree for resolving and handling
         if (foInputHandler instanceof FOTreeHandler) {
-            AreaTree at = ((FOTreeHandler)foInputHandler).doc.getDriver().getAreaTree();
+            FOTreeHandler foth = (FOTreeHandler)foInputHandler;
+            Document doc = (Document)foth.foTreeControl;
+            AreaTree at = doc.getDriver().getAreaTree();
             at.addTreeExtension(data);
             data.setAreaTree(at);
         }
index e5eb711153c8c072c52af9437658df6df146ad88..6220a59fe0e4459048468174624b563c9ad2f158 100644 (file)
@@ -72,7 +72,7 @@ import org.apache.fop.fo.flow.TableCell;
 import org.apache.fop.fo.flow.TableRow;
 import org.apache.fop.fo.pagination.Flow;
 import org.apache.fop.fo.pagination.PageSequence;
-import org.apache.fop.control.Document;
+import org.apache.fop.fo.FOTreeControl;
 
 import org.xml.sax.SAXException;
 
@@ -96,13 +96,13 @@ public abstract class FOInputHandler extends AbstractLogEnabled {
 
 //    public Driver driver = null;
 
-    public Document doc = null;
+    public FOTreeControl foTreeControl = null;
 
     /**
      * Main constructor
      */
-    public FOInputHandler(Document document) {
-        this.doc = document;
+    public FOInputHandler(FOTreeControl foTreeControl) {
+        this.foTreeControl = foTreeControl;
     }
 
     /**
@@ -117,7 +117,7 @@ public abstract class FOInputHandler extends AbstractLogEnabled {
      * Returns the FontInfo object associated with this FOInputHandler.
      * @return the FontInof object
      */
-    public Document getFontInfo() {
+    public FOTreeControl getFontInfo() {
         return null;
     }
 
index 81871df652ba8304d05670f40e5bad9044ac1e81..c960654cfbeb2b4156a9faf9207a1f63e13a4a28 100644 (file)
 
 package org.apache.fop.fo;
 
+// Java
+import java.util.Map;
+
+// FOP
 import org.apache.fop.fonts.FontMetrics;
 
 /**
@@ -69,4 +73,8 @@ public interface FOTreeControl {
 
     public FontMetrics getMetricsFor(String fontName);
 
+    public boolean isSetupValid();
+
+    public Map getFonts();
+
 }
index b1f09c01d28a2d7aa17ddd70d81914b92bd782c4..6556d4bbbd5316168afdea8e362d20dc97f3a0a2 100644 (file)
@@ -53,7 +53,6 @@ package org.apache.fop.fo;
 // Java
 import java.io.IOException;
 import java.io.OutputStream;
-import java.util.List;
 import java.util.HashSet;
 import java.util.Iterator;
 
@@ -61,10 +60,7 @@ import java.util.Iterator;
 import org.xml.sax.SAXException;
 
 // FOP
-import org.apache.fop.apps.Driver;
 import org.apache.fop.apps.FOPException;
-import org.apache.fop.area.StorePagesModel;
-import org.apache.fop.area.TreeExt;
 import org.apache.fop.fo.flow.Block;
 import org.apache.fop.fo.flow.ExternalGraphic;
 import org.apache.fop.fo.flow.InstreamForeignObject;
@@ -77,7 +73,6 @@ import org.apache.fop.fo.flow.TableCell;
 import org.apache.fop.fo.flow.TableRow;
 import org.apache.fop.fo.pagination.Flow;
 import org.apache.fop.fo.pagination.PageSequence;
-import org.apache.fop.control.Document;
 import org.apache.fop.render.Renderer;
 
 /**
@@ -135,14 +130,16 @@ public class FOTreeHandler extends FOInputHandler {
 
     /**
      * Main constructor
+     * @param foTreeControl the FOTreeControl implementation that governs this
+     * FO Tree
      * @param outputStream the stream that the result is rendered to
      * @param renderer the renderer to call
      * @param store if true then use the store pages model and keep the
      *              area tree in memory
      */
-    public FOTreeHandler(Document document, OutputStream outputStream, Renderer renderer,
-                         boolean store) {
-        super(document);
+    public FOTreeHandler(FOTreeControl foTreeControl, OutputStream outputStream,
+                         Renderer renderer, boolean store) {
+        super(foTreeControl);
         if (collectStatistics) {
             runtime = Runtime.getRuntime();
         }
@@ -169,9 +166,9 @@ public class FOTreeHandler extends FOInputHandler {
             startTime = System.currentTimeMillis();
         }
         try {
-            renderer.setupFontInfo(doc);
+            renderer.setupFontInfo(foTreeControl);
             // check that the "any,normal,400" font exists
-            if (!doc.isSetupValid()) {
+            if (!foTreeControl.isSetupValid()) {
                 throw new SAXException(new FOPException(
                         "No default font defined by OutputConverter"));
             }
@@ -472,8 +469,8 @@ public class FOTreeHandler extends FOInputHandler {
      *
      * @return the font information
      */
-    public Document getFontInfo() {
-        return this.doc;
+    public FOTreeControl getFontInfo() {
+        return foTreeControl;
     }
 
     /**
index a7e7de293a7cb83c7498c2f7d2f604c4e11ad8f5..4e672d14a86aa9208e6a08eefa018abc356c54b9 100644 (file)
@@ -71,7 +71,7 @@ import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonBackground;
 import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.control.Document;
+import org.apache.fop.fo.FOTreeControl;
 import org.apache.fop.fonts.Font;
 import org.apache.fop.fo.properties.CommonMarginInline;
 import org.apache.fop.fo.properties.CommonRelativePosition;
@@ -95,7 +95,7 @@ public class Leader extends FObjMixed {
     private int leaderPattern;
     private int patternWidth;
     /** FontInfo for this object */
-    protected Document fontInfo = null;
+    protected FOTreeControl fontInfo = null;
     /** FontState for this object */
     protected Font fontState;
     public InlineArea leaderArea = null;
index 9fd6cee922ea076725c839b6463e422379bfab01..3e0b2484d93b987afafa7e6be3157d755ef278bd 100644 (file)
@@ -59,7 +59,7 @@ import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonBackground;
 import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.control.Document;
+import org.apache.fop.fo.FOTreeControl;
 import org.apache.fop.fonts.Font;
 import org.apache.fop.fo.properties.CommonMarginInline;
 import org.apache.fop.fo.properties.CommonRelativePosition;
@@ -83,7 +83,7 @@ import org.apache.fop.area.Trait;
  */
 public class PageNumber extends FObj {
     /** FontInfo for this object */
-    protected Document fontInfo = null;
+    protected FOTreeControl fontInfo = null;
     /** FontState for this object */
     protected Font fontState;
 
index dfb4631cf764c68a72617c10239915470dda0e86..cbde1b202d04ebaab17ee6246798ddf71f34751b 100644 (file)
@@ -69,7 +69,7 @@ import org.apache.fop.fo.properties.CommonAccessibility;
 import org.apache.fop.fo.properties.CommonAural;
 import org.apache.fop.fo.properties.CommonBackground;
 import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.control.Document;
+import org.apache.fop.fo.FOTreeControl;
 import org.apache.fop.fonts.Font;
 import org.apache.fop.fo.properties.CommonMarginInline;
 import org.apache.fop.fo.properties.CommonRelativePosition;
@@ -90,7 +90,7 @@ import org.apache.fop.util.CharUtilities;
  */
 public class PageNumberCitation extends FObj {
     /** FontInfo for this object **/
-    protected Document fontInfo = null;
+    protected FOTreeControl fontInfo = null;
     /** Fontstate for this object **/
     protected Font fontState;
 
index 979946ff8c05fef9ad7a5b007aca94d8d6e83a89..aae674a74b57bef673fe1d2bc165f67df0615a6b 100644 (file)
@@ -88,7 +88,7 @@ import org.apache.fop.area.inline.Viewport;
 import org.apache.fop.area.inline.Word;
 import org.apache.fop.area.inline.Character;
 import org.apache.fop.fo.FOUserAgent;
-import org.apache.fop.control.Document;
+import org.apache.fop.fo.FOTreeControl;
 
 // Avalon
 import org.apache.avalon.framework.logger.AbstractLogEnabled;
@@ -168,7 +168,7 @@ public abstract class AbstractRenderer extends AbstractLogEnabled
     }
 
     /** @see org.apache.fop.render.Renderer */
-    public abstract void setupFontInfo(Document fontInfo);
+    public abstract void setupFontInfo(FOTreeControl foTreeControl);
 
     /** @see org.apache.fop.render.Renderer */
     public void setUserAgent(FOUserAgent agent) {
index cc5c66c3cc33ab05d341f4366eff97ce5859adeb..befd43b8e433a23a9326aaff82f3c062074ff8ed 100644 (file)
@@ -3,34 +3,34 @@
  * ============================================================================
  *                    The Apache Software License, Version 1.1
  * ============================================================================
- * 
+ *
  * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without modifica-
  * tion, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 
+ *
  * 2. Redistributions in binary form must reproduce the above copyright notice,
  *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution, if any, must
  *    include the following acknowledgment: "This product includes software
  *    developed by the Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself, if
  *    and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  *    endorse or promote products derived from this software without prior
  *    written permission. For written permission, please contact
  *    apache@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache", nor may
  *    "Apache" appear in their name, without prior written permission of the
  *    Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * ============================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many individuals
  * on behalf of the Apache Software Foundation and was originally created by
  * James Tauber <jtauber@jtauber.com>. For more information on the Apache
  * Software Foundation, please see <http://www.apache.org/>.
- */ 
+ */
 package org.apache.fop.render;
 
 // FOP
 import org.apache.fop.render.pdf.FontSetup;
 import org.apache.fop.control.Document;
+import org.apache.fop.fo.FOTreeControl;
 
 // Java
 import java.util.List;
@@ -61,7 +62,7 @@ import java.util.List;
 public abstract class PrintRenderer extends AbstractRenderer {
 
     /** Font configuration */
-    protected Document fontInfo;
+    protected FOTreeControl fontInfo;
 
     /** list of fonts */
     protected List fontList = null;
@@ -71,9 +72,9 @@ public abstract class PrintRenderer extends AbstractRenderer {
      *
      * @param fontInfo  font info to set up
      */
-    public void setupFontInfo(Document fontInfo) {
-        this.fontInfo = fontInfo;
-        FontSetup.setup(fontInfo, fontList);
+    public void setupFontInfo(FOTreeControl foTreeControl) {
+        this.fontInfo = foTreeControl;
+        FontSetup.setup((Document)fontInfo, fontList);
     }
 
 }
index 8582f5e825cd03374d5f3e6b49b3bc0e11a436a9..6141b9771ab42e5d1fb27943f990659b78849b99 100644 (file)
@@ -3,34 +3,34 @@
  * ============================================================================
  *                    The Apache Software License, Version 1.1
  * ============================================================================
- * 
+ *
  * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without modifica-
  * tion, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 
+ *
  * 2. Redistributions in binary form must reproduce the above copyright notice,
  *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution, if any, must
  *    include the following acknowledgment: "This product includes software
  *    developed by the Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself, if
  *    and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  *    endorse or promote products derived from this software without prior
  *    written permission. For written permission, please contact
  *    apache@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache", nor may
  *    "Apache" appear in their name, without prior written permission of the
  *    Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * ============================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many individuals
  * on behalf of the Apache Software Foundation and was originally created by
  * James Tauber <jtauber@jtauber.com>. For more information on the Apache
  * Software Foundation, please see <http://www.apache.org/>.
- */ 
+ */
 package org.apache.fop.render;
 
 // Java
@@ -66,7 +66,7 @@ import org.apache.fop.area.inline.Leader;
 import org.apache.fop.area.inline.Space;
 import org.apache.fop.area.inline.Viewport;
 import org.apache.fop.area.inline.Word;
-import org.apache.fop.control.Document;
+import org.apache.fop.fo.FOTreeControl;
 import org.apache.fop.fo.FOUserAgent;
 
 /**
@@ -123,7 +123,7 @@ public interface Renderer {
      *
      * @param fontInfo  The fonts
      */
-    void setupFontInfo(Document fontInfo);
+    void setupFontInfo(FOTreeControl foTreeControl);
 
     /**
      * Set up renderer options.
index 1a699f804b8a98cfbbddf3c3f76f0ec39209e30a..0c04be3d2dcb65bba2e6e0e36739a1a4d67d4655 100644 (file)
@@ -3,34 +3,34 @@
  * ============================================================================
  *                    The Apache Software License, Version 1.1
  * ============================================================================
- * 
+ *
  * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without modifica-
  * tion, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 
+ *
  * 2. Redistributions in binary form must reproduce the above copyright notice,
  *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution, if any, must
  *    include the following acknowledgment: "This product includes software
  *    developed by the Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself, if
  *    and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  *    endorse or promote products derived from this software without prior
  *    written permission. For written permission, please contact
  *    apache@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache", nor may
  *    "Apache" appear in their name, without prior written permission of the
  *    Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * ============================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many individuals
  * on behalf of the Apache Software Foundation and was originally created by
  * James Tauber <jtauber@jtauber.com>. For more information on the Apache
  * Software Foundation, please see <http://www.apache.org/>.
- */ 
+ */
 package org.apache.fop.render.awt;
 
 /*
@@ -78,6 +78,7 @@ import java.util.Map;
 // FOP
 import org.apache.fop.apps.InputHandler;
 import org.apache.fop.control.Document;
+import org.apache.fop.fo.FOTreeControl;
 import org.apache.fop.render.AbstractRenderer;
 import org.apache.fop.viewer.PreviewDialog;
 import org.apache.fop.viewer.Translator;
@@ -94,12 +95,12 @@ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable
     protected List pageList = new java.util.Vector();
     //protected ProgressListener progressListener = null;
 
-    /** 
-        The InputHandler associated with this Renderer.  
+    /**
+        The InputHandler associated with this Renderer.
         Sent to the PreviewDialog for document reloading.
     */
     protected InputHandler inputHandler;
-    
+
     /**
      * The resource bundle used for AWT messages.
      */
@@ -139,7 +140,7 @@ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable
      * valid font measures.
      */
     protected PreviewDialog frame;
-    
+
     public AWTRenderer(InputHandler handler) {
         inputHandler = handler;
         translator = new Translator();
@@ -159,11 +160,11 @@ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable
         return 0;
     }
 
-    public void setupFontInfo(Document fontInfo) {
+    public void setupFontInfo(FOTreeControl foTreeControl) {
         // create a temp Image to test font metrics on
         BufferedImage fontImage =
             new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
-        FontSetup.setup(fontInfo, fontImage.createGraphics());
+        FontSetup.setup((Document)foTreeControl, fontImage.createGraphics());
     }
 
     public int getPageNumber() {
@@ -212,7 +213,7 @@ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable
     public int print(Graphics g, PageFormat format, int pos) {
         return 0;
     }
-    
+
     private PreviewDialog createPreviewDialog(InputHandler handler) {
         frame = new PreviewDialog(this, handler);
         frame.addWindowListener(new WindowAdapter() {
@@ -233,7 +234,7 @@ public class AWTRenderer extends AbstractRenderer implements Printable, Pageable
         frame.setLocation((screenSize.width - frameSize.width) / 2,
                           (screenSize.height - frameSize.height) / 2);
         frame.setVisible(true);
-        frame.setStatus(translator.getString("Status.Build.FO.tree"));        
+        frame.setStatus(translator.getString("Status.Build.FO.tree"));
         return frame;
     }
 }
index 7d2239e3faabe2093a54fc2fd30a434760b31284..d1e7880dbbd2b427b4c1b65ece65b1198d6a2a51 100644 (file)
@@ -249,7 +249,8 @@ public class FontSetup {
      * @param resources PDFResources object to attach the font to
      * @param fontInfo font info object to get font information from
      */
-    public static void addToResources(PDFDocument doc, PDFResources resources, Document fontInfo) {
+    public static void addToResources(PDFDocument doc, PDFResources resources,
+                                      Document fontInfo) {
         Map fonts = fontInfo.getUsedFonts();
         Iterator e = fonts.keySet().iterator();
         while (e.hasNext()) {
index be653326b83859455051df27ed2bad22ccaed43d..baea57a9703c58ac2164ce2b77346db25188d335 100644 (file)
@@ -282,7 +282,8 @@ public class PDFRenderer extends PrintRenderer {
      * @see org.apache.fop.render.Renderer#stopRenderer()
      */
     public void stopRenderer() throws IOException {
-        FontSetup.addToResources(pdfDoc, pdfDoc.getResources(), fontInfo);
+        FontSetup.addToResources(pdfDoc, pdfDoc.getResources(),
+                                 (org.apache.fop.control.Document)fontInfo);
         pdfDoc.outputTrailer(ostream);
 
         this.pdfDoc = null;
index 5182bcfcca329eb6b30cb0f2f63d8128cede4139..6514fb2d642b42f9521f4c916321ad215f8ea482 100644 (file)
@@ -76,6 +76,7 @@ import org.apache.fop.fonts.Typeface;
 import org.apache.fop.control.Document;
 import org.apache.fop.render.AbstractRenderer;
 import org.apache.fop.render.RendererContext;
+import org.apache.fop.fo.FOTreeControl;
 
 import org.apache.fop.image.FopImage;
 import org.apache.fop.image.ImageFactory;
@@ -260,9 +261,9 @@ public class PSRenderer extends AbstractRenderer {
      *
      * @param fontInfo the font info object to set up
      */
-    public void setupFontInfo(Document fontInfo) {
+    public void setupFontInfo(FOTreeControl foTreeControl) {
         /* use PDF's font setup to get PDF metrics */
-        org.apache.fop.render.pdf.FontSetup.setup(fontInfo, null);
+        org.apache.fop.render.pdf.FontSetup.setup((Document)foTreeControl, null);
         this.fontInfo = fontInfo;
     }
 
index 4007821f2cb404dbffeeffbd117012f4f5c3cc3f..5181082ce0bb4bae6340ff664e21c3ffec4ea239 100644 (file)
@@ -60,6 +60,7 @@ import org.apache.fop.svg.SVGUtilities;
 import org.apache.fop.control.Document;
 import org.apache.fop.fo.FOUserAgent;
 import org.apache.fop.fo.properties.RuleStyle;
+import org.apache.fop.fo.FOTreeControl;
 
 import org.w3c.dom.Node;
 import org.w3c.dom.svg.SVGSVGElement;
@@ -167,11 +168,11 @@ public class SVGRenderer extends AbstractRenderer implements XMLHandler {
     /**
      * @see org.apache.fop.render.Renderer#setupFontInfo(FontInfo)
      */
-    public void setupFontInfo(Document fontInfo) {
+    public void setupFontInfo(FOTreeControl foTreeControl) {
         // create a temp Image to test font metrics on
         BufferedImage fontImage =
           new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB);
-        org.apache.fop.render.awt.FontSetup.setup(fontInfo,
+        org.apache.fop.render.awt.FontSetup.setup((Document)foTreeControl,
                 fontImage.createGraphics());
     }
 
index f6d37d587879f692eeaa9a95787ef2a6c4e71dd8..86aac11f78f09f555525de7c7738be300a623960 100644 (file)
@@ -93,6 +93,7 @@ import org.apache.fop.area.inline.Space;
 import org.apache.fop.area.inline.Viewport;
 import org.apache.fop.area.inline.Word;
 import org.apache.fop.fo.properties.RuleStyle;
+import org.apache.fop.fo.FOTreeControl;
 
 /**
  * Renderer that renders areas to XML for debugging purposes.
@@ -208,10 +209,10 @@ public class XMLRenderer extends AbstractRenderer {
      *
      * @param fontInfo the font info object to set up
      */
-    public void setupFontInfo(Document fontInfo) {
+    public void setupFontInfo(FOTreeControl foTreeControl) {
 
         /* use PDF's font setup to get PDF metrics */
-        org.apache.fop.render.pdf.FontSetup.setup(fontInfo, null);
+        org.apache.fop.render.pdf.FontSetup.setup((Document)foTreeControl, null);
     }
 
     private boolean isCoarseXml() {