From: William Victor Mote Date: Tue, 19 Aug 2003 06:54:31 +0000 (+0000) Subject: more FO Tree isolation work X-Git-Tag: Root_Temp_KnuthStylePageBreaking~1191 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=07c09d4368eec7bd75af4e928ba3ee7fbdc79a27;p=xmlgraphics-fop.git more FO Tree isolation work git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196812 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/extensions/Bookmarks.java b/src/java/org/apache/fop/extensions/Bookmarks.java index f383db27d..1326a1553 100644 --- a/src/java/org/apache/fop/extensions/Bookmarks.java +++ b/src/java/org/apache/fop/extensions/Bookmarks.java @@ -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); } diff --git a/src/java/org/apache/fop/fo/FOInputHandler.java b/src/java/org/apache/fop/fo/FOInputHandler.java index e5eb71115..6220a59fe 100644 --- a/src/java/org/apache/fop/fo/FOInputHandler.java +++ b/src/java/org/apache/fop/fo/FOInputHandler.java @@ -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; } diff --git a/src/java/org/apache/fop/fo/FOTreeControl.java b/src/java/org/apache/fop/fo/FOTreeControl.java index 81871df65..c960654cf 100644 --- a/src/java/org/apache/fop/fo/FOTreeControl.java +++ b/src/java/org/apache/fop/fo/FOTreeControl.java @@ -51,6 +51,10 @@ 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(); + } diff --git a/src/java/org/apache/fop/fo/FOTreeHandler.java b/src/java/org/apache/fop/fo/FOTreeHandler.java index b1f09c01d..6556d4bbb 100644 --- a/src/java/org/apache/fop/fo/FOTreeHandler.java +++ b/src/java/org/apache/fop/fo/FOTreeHandler.java @@ -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; } /** diff --git a/src/java/org/apache/fop/fo/flow/Leader.java b/src/java/org/apache/fop/fo/flow/Leader.java index a7e7de293..4e672d14a 100644 --- a/src/java/org/apache/fop/fo/flow/Leader.java +++ b/src/java/org/apache/fop/fo/flow/Leader.java @@ -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; diff --git a/src/java/org/apache/fop/fo/flow/PageNumber.java b/src/java/org/apache/fop/fo/flow/PageNumber.java index 9fd6cee92..3e0b2484d 100644 --- a/src/java/org/apache/fop/fo/flow/PageNumber.java +++ b/src/java/org/apache/fop/fo/flow/PageNumber.java @@ -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; diff --git a/src/java/org/apache/fop/fo/flow/PageNumberCitation.java b/src/java/org/apache/fop/fo/flow/PageNumberCitation.java index dfb4631cf..cbde1b202 100644 --- a/src/java/org/apache/fop/fo/flow/PageNumberCitation.java +++ b/src/java/org/apache/fop/fo/flow/PageNumberCitation.java @@ -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; diff --git a/src/java/org/apache/fop/render/AbstractRenderer.java b/src/java/org/apache/fop/render/AbstractRenderer.java index 979946ff8..aae674a74 100644 --- a/src/java/org/apache/fop/render/AbstractRenderer.java +++ b/src/java/org/apache/fop/render/AbstractRenderer.java @@ -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) { diff --git a/src/java/org/apache/fop/render/PrintRenderer.java b/src/java/org/apache/fop/render/PrintRenderer.java index cc5c66c3c..befd43b8e 100644 --- a/src/java/org/apache/fop/render/PrintRenderer.java +++ b/src/java/org/apache/fop/render/PrintRenderer.java @@ -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 @@ -42,17 +42,18 @@ * (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 . For more information on the Apache * Software Foundation, please see . - */ + */ 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); } } diff --git a/src/java/org/apache/fop/render/Renderer.java b/src/java/org/apache/fop/render/Renderer.java index 8582f5e82..6141b9771 100644 --- a/src/java/org/apache/fop/render/Renderer.java +++ b/src/java/org/apache/fop/render/Renderer.java @@ -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 @@ -42,12 +42,12 @@ * (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 . For more information on the Apache * Software Foundation, please see . - */ + */ 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. diff --git a/src/java/org/apache/fop/render/awt/AWTRenderer.java b/src/java/org/apache/fop/render/awt/AWTRenderer.java index 1a699f804..0c04be3d2 100644 --- a/src/java/org/apache/fop/render/awt/AWTRenderer.java +++ b/src/java/org/apache/fop/render/awt/AWTRenderer.java @@ -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 @@ -42,12 +42,12 @@ * (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 . For more information on the Apache * Software Foundation, please see . - */ + */ 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; } } diff --git a/src/java/org/apache/fop/render/pdf/FontSetup.java b/src/java/org/apache/fop/render/pdf/FontSetup.java index 7d2239e3f..d1e7880db 100644 --- a/src/java/org/apache/fop/render/pdf/FontSetup.java +++ b/src/java/org/apache/fop/render/pdf/FontSetup.java @@ -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()) { diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderer.java b/src/java/org/apache/fop/render/pdf/PDFRenderer.java index be653326b..baea57a97 100644 --- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java +++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java @@ -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; diff --git a/src/java/org/apache/fop/render/ps/PSRenderer.java b/src/java/org/apache/fop/render/ps/PSRenderer.java index 5182bcfcc..6514fb2d6 100644 --- a/src/java/org/apache/fop/render/ps/PSRenderer.java +++ b/src/java/org/apache/fop/render/ps/PSRenderer.java @@ -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; } diff --git a/src/java/org/apache/fop/render/svg/SVGRenderer.java b/src/java/org/apache/fop/render/svg/SVGRenderer.java index 4007821f2..5181082ce 100644 --- a/src/java/org/apache/fop/render/svg/SVGRenderer.java +++ b/src/java/org/apache/fop/render/svg/SVGRenderer.java @@ -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()); } diff --git a/src/java/org/apache/fop/render/xml/XMLRenderer.java b/src/java/org/apache/fop/render/xml/XMLRenderer.java index f6d37d587..86aac11f7 100644 --- a/src/java/org/apache/fop/render/xml/XMLRenderer.java +++ b/src/java/org/apache/fop/render/xml/XMLRenderer.java @@ -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() {