]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Added user config font registration to XML Renderer
authorManuel Mall <manuel@apache.org>
Fri, 18 Nov 2005 16:39:51 +0000 (16:39 +0000)
committerManuel Mall <manuel@apache.org>
Fri, 18 Nov 2005 16:39:51 +0000 (16:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@345517 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/xml/XMLRenderer.java

index e02b07f2fedf8c404e6b8df232905a6fea87f4c4..3de2faf3b44b50b330b2e8f312a91979bc7beab7 100644 (file)
@@ -30,6 +30,8 @@ import javax.xml.transform.TransformerConfigurationException;
 import javax.xml.transform.sax.SAXTransformerFactory;
 import javax.xml.transform.sax.TransformerHandler;
 import javax.xml.transform.stream.StreamResult;
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.ConfigurationException;
 
 import org.w3c.dom.Document;
 import org.xml.sax.Attributes;
@@ -69,6 +71,7 @@ import org.apache.fop.area.inline.Viewport;
 import org.apache.fop.area.inline.TextArea;
 import org.apache.fop.area.inline.SpaceArea;
 import org.apache.fop.area.inline.WordArea;
+import org.apache.fop.fonts.FontSetup;
 
 /**
  * Renderer that renders areas to XML for debugging purposes.
@@ -110,6 +113,22 @@ public class XMLRenderer extends PrintRenderer {
         context = new RendererContext(this, XML_MIME_TYPE);
     }
 
+    /**
+     * Configure the PDF renderer.
+     * Get the configuration to be used for pdf stream filters,
+     * fonts etc.
+     * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
+     */
+    public void configure(Configuration cfg) throws ConfigurationException {
+        //Font configuration
+        List cfgFonts = FontSetup.buildFontListFromConfiguration(cfg);
+        if (this.fontList == null) {
+            this.fontList = cfgFonts;
+        } else {
+            this.fontList.addAll(cfgFonts);
+        }
+    }
+
     /**
      * @see org.apache.fop.render.Renderer#setUserAgent(FOUserAgent)
      */