From c71b4374b1b89486e7103116eaace7c0adf9a84d Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Tue, 24 Mar 2009 08:08:54 +0000 Subject: Amendment to revision 755894: The mimicking fix didn't work for all output formats. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@757681 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/render/PrintRendererConfigurator.java | 7 ++----- src/java/org/apache/fop/render/intermediate/IFUtil.java | 7 +++++++ 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src/java') diff --git a/src/java/org/apache/fop/render/PrintRendererConfigurator.java b/src/java/org/apache/fop/render/PrintRendererConfigurator.java index 67dda0354..66618b093 100644 --- a/src/java/org/apache/fop/render/PrintRendererConfigurator.java +++ b/src/java/org/apache/fop/render/PrintRendererConfigurator.java @@ -29,7 +29,6 @@ import org.apache.fop.apps.FOPException; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.FopFactory; import org.apache.fop.fonts.CustomFontCollection; -import org.apache.fop.fonts.FontCache; import org.apache.fop.fonts.FontCollection; import org.apache.fop.fonts.FontEventAdapter; import org.apache.fop.fonts.FontEventListener; @@ -40,8 +39,6 @@ import org.apache.fop.fonts.FontResolver; import org.apache.fop.fonts.base14.Base14FontCollection; import org.apache.fop.render.intermediate.IFDocumentHandler; import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator; -import org.apache.fop.render.intermediate.IFUtil; -import org.apache.fop.util.LogUtil; /** * Base Print renderer configurator (mostly handles font configuration) @@ -108,7 +105,7 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator fontInfoConfigurator.configure(fontInfoList); return fontInfoList; } - + // ---=== IFDocumentHandler configuration ===--- /** {@inheritDoc} */ @@ -123,7 +120,7 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator List fontCollections = new java.util.ArrayList(); fontCollections.add(new Base14FontCollection(fontManager.isBase14KerningEnabled())); - Configuration cfg = super.getRendererConfig(IFUtil.getEffectiveMIMEType(documentHandler)); + Configuration cfg = super.getRendererConfig(documentHandler.getMimeType()); if (cfg != null) { FontResolver fontResolver = new DefaultFontResolver(userAgent); FontEventListener listener = new FontEventAdapter( diff --git a/src/java/org/apache/fop/render/intermediate/IFUtil.java b/src/java/org/apache/fop/render/intermediate/IFUtil.java index 58399f3ac..437648bcc 100644 --- a/src/java/org/apache/fop/render/intermediate/IFUtil.java +++ b/src/java/org/apache/fop/render/intermediate/IFUtil.java @@ -153,6 +153,13 @@ public class IFUtil { if (fontInfo == null) { fontInfo = new FontInfo(); } + if (documentHandler instanceof IFSerializer) { + IFSerializer serializer = (IFSerializer)documentHandler; + if (serializer.getMimickedDocumentHandler() != null) { + //Use the mimicked document handler's configurator to set up fonts + documentHandler = serializer.getMimickedDocumentHandler(); + } + } IFDocumentHandlerConfigurator configurator = documentHandler.getConfigurator(); if (configurator != null) { configurator.setupFontInfo(documentHandler, fontInfo); -- cgit v1.2.3