Modified: 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/PrintRenderer.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/PrintRenderer.java?rev=653827&r1=653826&r2=653827&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/PrintRenderer.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/PrintRenderer.java
 Tue May  6 09:18:51 2008
@@ -25,7 +25,6 @@
 import org.apache.fop.fonts.Font;
 import org.apache.fop.fonts.FontInfo;
 import org.apache.fop.fonts.FontResolver;
-import org.apache.fop.fonts.FontSetup;
 import org.apache.fop.fonts.FontTriplet;
 import org.w3c.dom.Document;
 
@@ -45,25 +44,32 @@
     protected FontResolver fontResolver = null;
 
     /** list of fonts */
-    protected List fontList = null;
+    protected List/*<EmbedFontInfo>*/ embedFontInfoList = null;
    
     /**
-     * adds a font list to current list of fonts
-     * @param fontInfoList font list
+     * Adds a font list to current list of fonts
+     * @param fontList a font info list
      */
-    public void addFontList(List fontInfoList) {
-        if (this.fontList == null) {
-            setFontList(fontInfoList);
+    public void addFontList(List/*<EmbedFontInfo>*/ fontList) {
+        if (embedFontInfoList == null) {
+            setFontList(fontList);
         } else {
-            this.fontList.addAll(fontInfoList);
+            fontList.addAll(fontList);
         }
     }
     
     /**
-     * @param fontList list of available fonts
+     * @param embedFontInfoList list of available fonts
      */
-    public void setFontList(List fontList) {
-        this.fontList = fontList;
+    public void setFontList(List/*<EmbedFontInfo>*/ embedFontInfoList) {
+        this.embedFontInfoList = embedFontInfoList;
+    }
+
+    /**
+     * @return list of available embedded fonts
+     */
+    public List/*<EmbedFontInfo>*/ getFontList() {
+        return this.embedFontInfoList;
     }
 
     /**
@@ -73,8 +79,7 @@
      */
     public void setupFontInfo(FontInfo inFontInfo) {
         this.fontInfo = inFontInfo;
-        FontSetup.setup(fontInfo, fontList, fontResolver, 
-                userAgent.getFactory().isBase14KerningEnabled());
+        userAgent.getFactory().getFontManager().setupRenderer(this);
     }
 
     /**
@@ -180,4 +185,11 @@
         }
         return this.fontResolver;
     }
+    
+    /**
+     * @return the font info
+     */
+    public FontInfo getFontInfo() {
+        return this.fontInfo;
+    }
 }

Modified: 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/PrintRendererConfigurator.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/PrintRendererConfigurator.java?rev=653827&r1=653826&r2=653827&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/PrintRendererConfigurator.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/PrintRendererConfigurator.java
 Tue May  6 09:18:51 2008
@@ -44,8 +44,8 @@
 import org.apache.fop.fonts.EmbedFontInfo;
 import org.apache.fop.fonts.FontCache;
 import org.apache.fop.fonts.FontInfo;
+import org.apache.fop.fonts.FontManager;
 import org.apache.fop.fonts.FontResolver;
-import org.apache.fop.fonts.FontSetup;
 import org.apache.fop.fonts.FontTriplet;
 import org.apache.fop.fonts.FontUtil;
 import org.apache.fop.fonts.autodetect.FontFileFinder;
@@ -78,28 +78,30 @@
     public void configure(Renderer renderer) throws FOPException {
         Configuration cfg = getRendererConfig(renderer);
         if (cfg == null) {
+            log.trace("no configuration found for " + renderer);
             return;
         }
 
         PrintRenderer printRenderer = (PrintRenderer)renderer;
         FontResolver fontResolver = printRenderer.getFontResolver();
+        FopFactory factory = userAgent.getFactory();
+        FontManager fontManager = factory.getFontManager();
         if (fontResolver == null) {
             //Ensure that we have minimal font resolution capabilities
-            fontResolver = FontSetup.createMinimalFontResolver();
+            fontResolver = FontManager.createMinimalFontResolver();
         }
 
-        FopFactory factory = userAgent.getFactory();
         boolean strict = factory.validateUserConfigStrictly();
-        FontCache fontCache = factory.getFontCache();
+        FontCache fontCache = fontManager.getFontCache();
 
-        List fontInfoList = buildFontListFromConfiguration(cfg, 
+        List/*<EmbedFontInfo>*/ embedFontInfoList = 
buildFontListFromConfiguration(cfg, 
                 userAgent.getFontBaseURL(), fontResolver, strict, 
                 fontCache);
         
         if (fontCache != null && fontCache.hasChanged()) {
             fontCache.save();
         }
-        printRenderer.addFontList(fontInfoList);
+        printRenderer.addFontList(embedFontInfoList);
     }
 
     /**
@@ -113,10 +115,11 @@
      * @return a List of EmbedFontInfo objects.
      * @throws FOPException If an error occurs while processing the 
configuration
      */
-    public static List buildFontListFromConfiguration(Configuration cfg, 
+    public static List/*<EmbedFontInfo>*/ 
buildFontListFromConfiguration(Configuration cfg, 
             String fontBaseURL, FontResolver fontResolver, 
             boolean strict, FontCache fontCache) throws FOPException {
-        List fontInfoList = new java.util.ArrayList();
+        List/*<EmbedFontInfo>*/ fontInfoList
+            = new java.util.ArrayList/*<EmbedFontInfo>*/();
 
         Configuration fonts = cfg.getChild("fonts", false);
         if (fonts != null) {
@@ -204,12 +207,13 @@
             // font file (singular) configuration
             Configuration[] font = fonts.getChildren("font");
             for (int i = 0; i < font.length; i++) {
-                EmbedFontInfo fontInfo = getFontInfoFromConfiguration(
+                EmbedFontInfo embedFontInfo = getFontInfoFromConfiguration(
                         font[i], fontResolver, strict, fontCache);
-                if (fontInfo != null) {
-                    fontInfoList.add(fontInfo);
+                if (embedFontInfo != null) {
+                    fontInfoList.add(embedFontInfo);
                 }
             }
+                        
             if (log.isDebugEnabled()) {
                 log.debug("Finished font configuration in " 
                         + (System.currentTimeMillis() - start) + "ms");
@@ -221,11 +225,12 @@
     /**
      * Iterates over font file list adding font info to list
      * @param fontFileList font file list
-     * @param fontInfoList font info list
+     * @param embedFontInfoList a configured font info list
      * @param resolver font resolver
      */
     private static void addFontInfoListFromFileList(
-            List fontFileList, List fontInfoList, FontResolver resolver, 
FontCache fontCache) {
+            List fontFileList, List/*<EmbedFontInfo>*/ embedFontInfoList,
+            FontResolver resolver, FontCache fontCache) {
         for (Iterator iter = fontFileList.iterator(); iter.hasNext();) {
             URL fontUrl = (URL)iter.next();
             // parse font to ascertain font info
@@ -242,7 +247,7 @@
             for (int i = 0, c = embedFontInfos.length; i < c; i++) {
                 EmbedFontInfo fontInfo = embedFontInfos[i];
                 if (fontInfo != null) {
-                    fontInfoList.add(fontInfo);
+                    embedFontInfoList.add(fontInfo);
                 }
             }
         }
@@ -257,24 +262,64 @@
     }
 
     /**
+     * Creates a new FontTriplet given a triple Configuration
+     * 
+     * @param tripletCfg a triplet configuration
+     * @param strict use strict validation
+     * @return a font triplet font key
+     * @throws FOPException thrown if a FOP exception occurs
+     */
+    private static FontTriplet getFontTripletFromConfiguration(
+            Configuration tripletCfg, boolean strict) throws FOPException {
+        try {
+            String name = tripletCfg.getAttribute("name");
+            if (name == null) {
+                LogUtil.handleError(log, "font-triplet without name", strict);
+                return null;
+            }
+            
+            String weightStr = tripletCfg.getAttribute("weight");
+            if (weightStr == null) {
+                LogUtil.handleError(log, "font-triplet without weight", 
strict);
+                return null;
+            }
+            int weight = 
FontUtil.parseCSS2FontWeight(FontUtil.stripWhiteSpace(weightStr));
+            
+            String style = tripletCfg.getAttribute("style");
+            if (style == null) {
+                LogUtil.handleError(log, "font-triplet without style", strict);
+                return null;
+            } else {
+                style = FontUtil.stripWhiteSpace(style);
+            }
+            return FontInfo.createFontKey(name, style, weight);
+        } catch (ConfigurationException e) {
+            LogUtil.handleException(log, e, strict);
+        }
+        return null;
+    }
+    
+    /**
      * Returns a font info from a font node Configuration definition
      * 
      * @param fontCfg Configuration object (font node)
      * @param fontResolver font resolver used to resolve font
      * @param strict validate configuration strictly
      * @param fontCache the font cache (or null if it is disabled)
-     * @return font info
+     * @return the embedded font info
      * @throws FOPException if something's wrong with the config data
      */
-    public static EmbedFontInfo getFontInfoFromConfiguration(
+    private static EmbedFontInfo getFontInfoFromConfiguration(
             Configuration fontCfg, FontResolver fontResolver, boolean strict, 
FontCache fontCache)
                     throws FOPException {
         String metricsUrl = fontCfg.getAttribute("metrics-url", null);
         String embedUrl = fontCfg.getAttribute("embed-url", null);
         String subFont = fontCfg.getAttribute("sub-font", null);
-
+        
         if (metricsUrl == null && embedUrl == null) {
-            LogUtil.handleError(log, "Font configuration without metric-url or 
embed-url", strict);
+            LogUtil.handleError(log,
+                    "Font configuration without metric-url or embed-url 
attribute",
+                    strict);
             return null;
         }
         if (strict) {
@@ -299,15 +344,13 @@
                 }
             }
         }
-        boolean useKerning = fontCfg.getAttributeAsBoolean("kerning", true);
                         
-        EmbedFontInfo fontInfo = null;
         Configuration[] tripletCfg = fontCfg.getChildren("font-triplet");
+        
         // no font triplet info
         if (tripletCfg.length == 0) {
             LogUtil.handleError(log, "font without font-triplet", strict);
-
-            // if not strict try to determine font info from the embed/metrics 
url
+            
             File fontFile = FontCache.getFileFromUrls(new String[] {embedUrl, 
metricsUrl});
             URL fontUrl;
             try {
@@ -324,53 +367,36 @@
             } else {
                 return null;
             }
-        } else {
-            List tripleList = new java.util.ArrayList();
-            for (int j = 0; j < tripletCfg.length; j++) {
-                try {
-                    String name = tripletCfg[j].getAttribute("name");
-                    if (name == null) {
-                        LogUtil.handleError(log, "font-triplet without name", 
strict);
-                        continue;
-                    }
-                    String weightStr = tripletCfg[j].getAttribute("weight");
-                    if (weightStr == null) {
-                        LogUtil.handleError(log, "font-triplet without 
weight", strict);
-                        continue;
-                    }
-                    int weight = FontUtil.parseCSS2FontWeight(weightStr);
-                    String style = tripletCfg[j].getAttribute("style");
-                    if (style == null) {
-                        LogUtil.handleError(log, "font-triplet without style", 
strict);
-                        continue;
-                    }
-                    tripleList.add(FontInfo.createFontKey(name, style, 
weight));
-                } catch (ConfigurationException e) {
-                    LogUtil.handleException(log, e, strict);
-                }
-            }
-            
-            fontInfo = new EmbedFontInfo(metricsUrl, useKerning, tripleList, 
embedUrl, subFont);
-            
-            if (fontCache != null) {
-                if (!fontCache.containsFont(fontInfo)) {
-                    fontCache.addFont(fontInfo);                    
-                }
+        }
+        
+        List/*<FontTriplet>*/ tripletList = new 
java.util.ArrayList/*<FontTriplet>*/();
+        for (int j = 0; j < tripletCfg.length; j++) {
+            FontTriplet fontTriplet = 
getFontTripletFromConfiguration(tripletCfg[j], strict);
+            tripletList.add(fontTriplet);
+        }
+        
+        boolean useKerning = fontCfg.getAttributeAsBoolean("kerning", true);
+        EmbedFontInfo embedFontInfo
+            = new EmbedFontInfo(metricsUrl, useKerning, tripletList, embedUrl, 
subFont);
+        if (fontCache != null) {
+            if (!fontCache.containsFont(embedFontInfo)) {
+                fontCache.addFont(embedFontInfo);                    
             }
-
-            if (log.isDebugEnabled()) {
-                log.debug("Adding font " + fontInfo.getEmbedFile()
-                        + ", metric file " + fontInfo.getMetricsFile());
-                for (int j = 0; j < tripleList.size(); ++j) {
-                    FontTriplet triplet = (FontTriplet) tripleList.get(j);
-                    log.debug("  Font triplet "
-                            + triplet.getName() + ", "
-                            + triplet.getStyle() + ", "
-                            + triplet.getWeight());
-                }
-            }            
         }
-        return fontInfo;
+        
+        if (log.isDebugEnabled()) {
+            String embedFile = embedFontInfo.getEmbedFile();
+            log.debug("Adding font " + (embedFile != null ? embedFile + ", " : 
"")
+                    + "metric file " + embedFontInfo.getMetricsFile());
+            for (int j = 0; j < tripletList.size(); ++j) {
+                FontTriplet triplet = (FontTriplet) tripletList.get(j);
+                log.debug("  Font triplet "
+                        + triplet.getName() + ", "
+                        + triplet.getStyle() + ", "
+                        + triplet.getWeight());
+            }
+        }            
+        return embedFontInfo;
     }
     
 }

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=653827&r1=653826&r2=653827&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
 Tue May  6 09:18:51 2008
@@ -283,8 +283,8 @@
     public void setupFontInfo(FontInfo inFontInfo) {
         this.fontInfo = inFontInfo;
         int num = 1;
-        if (this.fontList != null && this.fontList.size() > 0) {
-            for (Iterator it = this.fontList.iterator(); it.hasNext();) {
+        if (super.embedFontInfoList != null && super.embedFontInfoList.size() 
> 0) {
+            for (Iterator it = super.embedFontInfoList.iterator(); 
it.hasNext();) {
                 AFPFontInfo afi = (AFPFontInfo)it.next();
                 AFPFont bf = (AFPFont)afi.getAFPFont();
                 for (Iterator it2 = afi.getFontTriplets().iterator(); 
it2.hasNext();) {

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=653827&r1=653826&r2=653827&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
 Tue May  6 09:18:51 2008
@@ -168,14 +168,15 @@
     public void setupFontInfo(FontInfo inFontInfo) {
         //Don't call super.setupFontInfo() here! Java2D needs a special font 
setup
         // create a temp Image to test font metrics on
-        fontInfo = inFontInfo;
+        this.fontInfo = inFontInfo;
         BufferedImage fontImage = new BufferedImage(100, 100,
                 BufferedImage.TYPE_INT_RGB);
-        Graphics2D g = fontImage.createGraphics();
+        Graphics2D graphics2D = fontImage.createGraphics();
         //The next line is important to get accurate font metrics!
-        g.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, 
+        graphics2D.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, 
                 RenderingHints.VALUE_FRACTIONALMETRICS_ON);
-        FontSetup.setup(fontInfo, fontList, fontResolver, g);
+        
+        userAgent.getFactory().getFontManager().setupRenderer(this, 
graphics2D);
     }
 
     /** [EMAIL PROTECTED] */

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=653827&r1=653826&r2=653827&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
 Tue May  6 09:18:51 2008
@@ -89,7 +89,6 @@
 import org.apache.fop.render.RendererContextConstants;
 import org.apache.fop.render.RendererEventProducer;
 import org.apache.fop.render.java2d.FontMetricsMapper;
-import org.apache.fop.render.java2d.FontSetup;
 import org.apache.fop.render.java2d.Java2DRenderer;
 import org.apache.fop.render.pcl.extensions.PCLElementMapping;
 import org.apache.fop.traits.BorderProps;
@@ -202,11 +201,12 @@
         fontInfo = inFontInfo;
         BufferedImage fontImage = new BufferedImage(100, 100,
                 BufferedImage.TYPE_INT_RGB);
-        Graphics2D g = fontImage.createGraphics();
+        Graphics2D graphics2D = fontImage.createGraphics();
         //The next line is important to get accurate font metrics!
-        g.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, 
+        graphics2D.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, 
                 RenderingHints.VALUE_FRACTIONALMETRICS_ON);
-        FontSetup.setup(fontInfo, fontList, fontResolver, g);
+        
+        userAgent.getFactory().getFontManager().setupRenderer(this, 
graphics2D);
     }
 
     /**

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=653827&r1=653826&r2=653827&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
 Tue May  6 09:18:51 2008
@@ -98,7 +98,7 @@
         if (!isTextStroked()) {
             FontInfo fontInfo = new FontInfo();   
             //TODO Do custom font configuration here somewhere/somehow 
-            FontSetup.setup(fontInfo, null, null);   
+            FontSetup.setup(fontInfo);   
             graphics.setCustomTextHandler(new NativeTextHandler(graphics, 
fontInfo));
         }
 

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=653827&r1=653826&r2=653827&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
 Tue May  6 09:18:51 2008
@@ -71,7 +71,7 @@
     private void setupFontInfo() {
         //Sets up a FontInfo with default fonts
         fontInfo = new FontInfo();
-        FontSetup.setup(fontInfo, null, null);
+        FontSetup.setup(fontInfo);
     }
     
     /**

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=653827&r1=653826&r2=653827&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
 Tue May  6 09:18:51 2008
@@ -156,7 +156,7 @@
         if (fontInfo == null) {
             //Default minimal fonts
             FontInfo fontInfo = new FontInfo();
-            FontSetup.setup(fontInfo, null, null);
+            FontSetup.setup(fontInfo);
             setFontInfo(fontInfo);
         }
     }

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=653827&r1=653826&r2=653827&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
 Tue May  6 09:18:51 2008
@@ -26,6 +26,7 @@
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.fonts.FontCache;
 import org.apache.fop.fonts.FontInfo;
+import org.apache.fop.fonts.FontManager;
 import org.apache.fop.fonts.FontResolver;
 import org.apache.fop.fonts.FontSetup;
 import org.apache.fop.pdf.PDFDocument;
@@ -53,17 +54,20 @@
         
         //Fonts
         try {
-            FontResolver fontResolver = FontSetup.createMinimalFontResolver();
+            FontResolver fontResolver = 
FontManager.createMinimalFontResolver();
             //TODO The following could be optimized by retaining the FontCache 
somewhere
             FontCache fontCache = FontCache.load();
             if (fontCache == null) {
                 fontCache = new FontCache();
             }
-            List fontList = 
PrintRendererConfigurator.buildFontListFromConfiguration(
-                    cfg, null, fontResolver, false, fontCache);
+            //TODO Provide fontBaseURL to this method call
+            final String fontBaseURL = null;
+            List/*<EmbedFontInfo>*/ embedFontInfoList
+                = PrintRendererConfigurator.buildFontListFromConfiguration(
+                    cfg, fontBaseURL, fontResolver, false, fontCache);
             fontCache.save();
             FontInfo fontInfo = new FontInfo();
-            FontSetup.setup(fontInfo, fontList, fontResolver);
+            FontSetup.setup(fontInfo, embedFontInfoList, fontResolver);
             graphics.setFontInfo(fontInfo);
         } catch (FOPException e) {
             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=653827&r1=653826&r2=653827&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
 Tue May  6 09:18:51 2008
@@ -959,7 +959,7 @@
         preparePainting();
 
         FontInfo specialFontInfo = new FontInfo();
-        FontSetup.setup(specialFontInfo, null, null);
+        FontSetup.setup(specialFontInfo);
 
         PDFResources res = pdfDoc.getFactory().makeResources();
         PDFResourceContext context = new PDFResourceContext(res);

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml?rev=653827&r1=653826&r2=653827&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/status.xml Tue May  6 
09:18:51 2008
@@ -60,6 +60,10 @@
       <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="Fonts" dev="AC" type="add">
+        Add support for font substitution.
+      </action>
+      <action context="Code" dev="AD" type="fix" fixed-bug="44203">
       <action context="Renderers" dev="JM" type="fix" fixes-bug="43650">
         PCL Renderer: Improved page format selection so it doesn't interfere 
with
         duplex printing.

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=653827&r1=653826&r2=653827&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
 Tue May  6 09:18:51 2008
@@ -66,7 +66,7 @@
         final File baseDir = getBaseDir();
         final String fontFOFilePath = getFontFOFilePath();
         File foFile = new File(baseDir, fontFOFilePath);
-        final boolean dumpOutput = false;
+        final boolean dumpOutput = true;
         FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
         convertFO(foFile, foUserAgent, dumpOutput);
     }

Modified: 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/config/UserConfigTestSuite.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/config/UserConfigTestSuite.java?rev=653827&r1=653826&r2=653827&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/config/UserConfigTestSuite.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/config/UserConfigTestSuite.java
 Tue May  6 09:18:51 2008
@@ -44,6 +44,7 @@
         suite.addTest(new TestSuite(FontEmbedUrlMalformedTestCase.class));
         suite.addTest(new TestSuite(FontsDirectoryRecursiveTestCase.class));
         suite.addTest(new TestSuite(FontsAutoDetectTestCase.class));
+        suite.addTest(new TestSuite(FontsSubstitutionTestCase.class));
         //$JUnit-END$
         return suite;
     }

Modified: 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java?rev=653827&r1=653826&r2=653827&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/layoutengine/LayoutEngineTester.java
 Tue May  6 09:18:51 2008
@@ -95,8 +95,8 @@
      */
     public LayoutEngineTester(File areaTreeBackupDir) {
         this.areaTreeBackupDir = areaTreeBackupDir;
-        fopFactory.setBase14KerningEnabled(false);
-        fopFactoryWithBase14Kerning.setBase14KerningEnabled(true);
+        fopFactory.getFontManager().setBase14KerningEnabled(false);
+        
fopFactoryWithBase14Kerning.getFontManager().setBase14KerningEnabled(true);
     }
     
     private Templates getTestcase2FOStylesheet() throws 
TransformerConfigurationException {

Modified: 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/render/pdf/BasePDFTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/render/pdf/BasePDFTestCase.java?rev=653827&r1=653826&r2=653827&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/render/pdf/BasePDFTestCase.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/render/pdf/BasePDFTestCase.java
 Tue May  6 09:18:51 2008
@@ -101,7 +101,7 @@
         }
     }
 
-    private static Exception extractOriginalException(Exception e) {
+    protected static Exception extractOriginalException(Exception e) {
         if (e.getCause() != null) {
             return extractOriginalException((Exception)e.getCause());
         } else if (e instanceof SAXException) {

Modified: 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/render/pdf/PDFAConformanceTestCase.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/render/pdf/PDFAConformanceTestCase.java?rev=653827&r1=653826&r2=653827&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/render/pdf/PDFAConformanceTestCase.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/test/java/org/apache/fop/render/pdf/PDFAConformanceTestCase.java
 Tue May  6 09:18:51 2008
@@ -44,9 +44,9 @@
      *  @return an initialized FOUserAgent
      * */
     protected FOUserAgent getUserAgent() {
-        final FOUserAgent a = fopFactory.newFOUserAgent();
-        a.getRendererOptions().put("pdf-a-mode", "PDF/A-1b");
-        return a;
+        final FOUserAgent userAgent = fopFactory.newFOUserAgent();
+        userAgent.getRendererOptions().put("pdf-a-mode", "PDF/A-1b");
+        return userAgent;
     }
     
     /**
@@ -104,5 +104,5 @@
             //Good!
         }
     }
-    
+
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to