aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/svg
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2008-05-08 09:55:55 +0000
committerJeremias Maerki <jeremias@apache.org>2008-05-08 09:55:55 +0000
commitc68f717f73d501c415aa0630db12a17ea720d145 (patch)
treea161e0e32f7e8816df160570985eb8fec4536921 /src/java/org/apache/fop/svg
parent0c1a6a21c219d237e43e6ded1d6bf1adb58e79c3 (diff)
downloadxmlgraphics-fop-c68f717f73d501c415aa0630db12a17ea720d145.tar.gz
xmlgraphics-fop-c68f717f73d501c415aa0630db12a17ea720d145.zip
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
Diffstat (limited to 'src/java/org/apache/fop/svg')
-rw-r--r--src/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java21
1 files changed, 11 insertions, 10 deletions
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/*<EmbedFontInfo>*/ 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);