You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2006/08/02 22:37:19 UTC
svn commit: r428137 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop:
fonts/FontSetup.java svg/PDFDocumentGraphics2D.java
Author: jeremias
Date: Wed Aug 2 13:37:18 2006
New Revision: 428137
URL: http://svn.apache.org/viewvc?rev=428137&view=rev
Log:
Reestablish custom font configuration for PDFTranscoder.
Modified:
xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontSetup.java
xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontSetup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontSetup.java?rev=428137&r1=428136&r2=428137&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontSetup.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontSetup.java Wed Aug 2 13:37:18 2006
@@ -46,6 +46,9 @@
// 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 @@
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 @@
}
}
+ /** @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
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java?rev=428137&r1=428136&r2=428137&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java Wed Aug 2 13:37:18 2006
@@ -165,7 +165,7 @@
* @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",
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org