From c68f717f73d501c415aa0630db12a17ea720d145 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Thu, 8 May 2008 09:55:55 +0000 Subject: Added support for font referencing for auto-detected fonts. Referenced TrueType fonts can now use glyphs outside the WinAnsi charset (Same approach as for extended glyph support with Type 1 fonts). Removed FopFactory reference from FontManager to make the class more useful outside this context (ex. transcoders). Updated fonts documentation with information that TTCs are now supported through auto-detection. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@654461 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/svg/PDFDocumentGraphics2DConfigurator.java | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/java/org/apache/fop/svg') diff --git a/src/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java b/src/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java index 02e9d6da4..789a7c247 100644 --- a/src/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java +++ b/src/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java @@ -23,8 +23,8 @@ import java.util.List; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; + 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; @@ -55,17 +55,18 @@ public class PDFDocumentGraphics2DConfigurator { //Fonts try { 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(); - } - //TODO Provide fontBaseURL to this method call - final String fontBaseURL = null; + //TODO The following could be optimized by retaining the FontManager somewhere + FontManager fontManager = new FontManager(); + + //TODO Make use of fontBaseURL, font substitution and referencing configuration + //Requires a change to the expected configuration layout + List/**/ embedFontInfoList = PrintRendererConfigurator.buildFontListFromConfiguration( - cfg, fontBaseURL, fontResolver, false, fontCache); - fontCache.save(); + cfg, fontResolver, false, fontManager); + if (fontManager.useCache()) { + fontManager.getFontCache().save(); + } FontInfo fontInfo = new FontInfo(); FontSetup.setup(fontInfo, embedFontInfoList, fontResolver); graphics.setFontInfo(fontInfo); -- cgit v1.2.3