From 8c1aba3f976127d33ec50b67d760f56364c08487 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Mon, 28 May 2007 14:31:24 +0000 Subject: Bugzilla #41831: - Add support font auto-detection (easier font configuration) including a font cache to speed up the auto-detection process. - Refactoring of the configuration code: All Avalon configuration stuff is extracted into separate "Configurator" classes. - Refactoring of the FOURIResolver. Submitted by: Adrian Cumiskey Changes to the patch by jeremias during the review: - Font cache simplified (Java object serialization instead of XML), functionality fixed and moved to the fonts.package. - Relocated default cache file location to user directory. - Fixed the font configuration for PDFDocumentGraphics2D/PDFTranscoder that got lost with the patch. - Fixed a problem with having a non-file URL as font base URL. - Simplified RendererContextInfo stuff to make it easier to understand. - Fixed handling of Type 1 fonts in auto-detection. - Reduced verbosity of font-related log output. - Updated Jakarta Commons IO to version 1.3.1 (the patch depends on it) - Various javadocs improvements git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@542237 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/render/afp/AFPRenderer.java | 211 ++---------------- .../fop/render/afp/AFPRendererConfigurator.java | 241 +++++++++++++++++++++ .../apache/fop/render/afp/AFPRendererMaker.java | 8 +- 3 files changed, 265 insertions(+), 195 deletions(-) create mode 100644 src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java (limited to 'src/java/org/apache/fop/render/afp') diff --git a/src/java/org/apache/fop/render/afp/AFPRenderer.java b/src/java/org/apache/fop/render/afp/AFPRenderer.java index 78d8b7d0a..ea1087893 100644 --- a/src/java/org/apache/fop/render/afp/AFPRenderer.java +++ b/src/java/org/apache/fop/render/afp/AFPRenderer.java @@ -33,8 +33,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import org.apache.avalon.framework.configuration.Configuration; -import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.MimeConstants; @@ -57,8 +55,6 @@ import org.apache.fop.fo.extensions.ExtensionAttachment; import org.apache.fop.fonts.FontInfo; import org.apache.fop.fonts.FontMetrics; import org.apache.fop.fonts.FontTriplet; -import org.apache.fop.fonts.FontUtil; -import org.apache.fop.fonts.Typeface; import org.apache.fop.fonts.base14.Courier; import org.apache.fop.fonts.base14.Helvetica; import org.apache.fop.fonts.base14.TimesRoman; @@ -76,7 +72,6 @@ import org.apache.fop.render.afp.fonts.AFPFont; import org.apache.fop.render.afp.fonts.CharacterSet; import org.apache.fop.render.afp.fonts.FopCharacterSet; import org.apache.fop.render.afp.fonts.OutlineFont; -import org.apache.fop.render.afp.fonts.RasterFont; import org.apache.fop.render.afp.modca.AFPConstants; import org.apache.fop.render.afp.modca.AFPDataStream; import org.apache.fop.render.afp.modca.ImageObject; @@ -302,195 +297,6 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { } } - /** - */ - private AFPFontInfo buildFont(Configuration fontCfg, String _path) - throws ConfigurationException { - - Configuration[] triple = fontCfg.getChildren("font-triplet"); - List tripleList = new java.util.ArrayList(); - if (triple.length == 0) { - log.error("Mandatory font configuration element '