diff options
author | Jeremias Maerki <jeremias@apache.org> | 2006-08-02 20:37:18 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2006-08-02 20:37:18 +0000 |
commit | 055b132d624265bf7bfffb4f1c2991fd88849480 (patch) | |
tree | 5b7a02d975ca928a979e1ac154ae4eafe6f27abc /src/java | |
parent | 99901f942d249cda9c88d2ef317c8143ac1770e8 (diff) | |
download | xmlgraphics-fop-055b132d624265bf7bfffb4f1c2991fd88849480.tar.gz xmlgraphics-fop-055b132d624265bf7bfffb4f1c2991fd88849480.zip |
Reestablish custom font configuration for PDFTranscoder.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@428137 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/org/apache/fop/fonts/FontSetup.java | 20 | ||||
-rw-r--r-- | src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java | 2 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/fonts/FontSetup.java b/src/java/org/apache/fop/fonts/FontSetup.java index fffcf9c62..4c9e3b768 100644 --- a/src/java/org/apache/fop/fonts/FontSetup.java +++ b/src/java/org/apache/fop/fonts/FontSetup.java @@ -46,6 +46,9 @@ import org.apache.avalon.framework.configuration.ConfigurationException; // Java import java.util.List; +import javax.xml.transform.Source; +import javax.xml.transform.stream.StreamSource; + /** * Default fonts for FOP application; currently this uses PDF's fonts * by default. @@ -194,6 +197,11 @@ public class FontSetup { return; //No fonts to process } + if (resolver == null) { + //Ensure that we have minimal font resolution capabilities + resolver = createMinimalFontResolver(); + } + String internalName = null; //FontReader reader = null; @@ -229,6 +237,18 @@ public class FontSetup { } } + /** @return a new FontResolver to be used by the font subsystem */ + private static FontResolver createMinimalFontResolver() { + return new FontResolver() { + + /** @see org.apache.fop.fonts.FontResolver#resolve(java.lang.String) */ + public Source resolve(String href) { + //Minimal functionality here + return new StreamSource(href); + } + + }; + } /** * Builds a list of EmbedFontInfo objects for use with the setup() method. * @param cfg Configuration object diff --git a/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java b/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java index 4d7ac826c..74dac01fe 100644 --- a/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java +++ b/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java @@ -165,7 +165,7 @@ public class PDFDocumentGraphics2D extends PDFGraphics2D * @see org.apache.avalon.framework.activity.Initializable#initialize() */ public void initialize() throws Exception { - if (this.fontInfo == null) { + if (this.fontInfo == null || this.cfg != null) { fontInfo = new FontInfo(); FontSetup.setup(fontInfo, this.pdfContext.getFontList(), null); //FontState fontState = new FontState("Helvetica", "normal", |