From 6b14d502651d693ec516d87b60f876d7c594a12a Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Mon, 20 Apr 2009 10:23:56 +0000 Subject: [PATCH] Disabled auto-fonts in the PS transcoders by default because of OutOfMemoryErrors. Details in code comments. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@766644 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/render/ps/AbstractPSTranscoder.java | 9 +++++++++ src/java/org/apache/fop/svg/AbstractFOPTranscoder.java | 10 +++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java b/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java index d6f5fe2ed..f991cdf54 100644 --- a/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java +++ b/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java @@ -88,6 +88,15 @@ public abstract class AbstractPSTranscoder extends AbstractFOPTranscoder { */ protected abstract AbstractPSDocumentGraphics2D createDocumentGraphics2D(); + /** {@inheritDoc} */ + protected boolean getAutoFontsDefault() { + //Currently set to false because auto-fonts requires a lot of memory in the PostScript + //case: All fonts (even the unsupported TTF fonts) need to be loaded and TrueType loading + //is currently very memory-intensive. At default JVM memory settings, this woudl result + //in OutOfMemoryErrors otherwise. + return false; + } + /** * Transcodes the specified Document as an image in the specified output. * diff --git a/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java b/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java index caae32cf0..551da21df 100644 --- a/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java +++ b/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java @@ -134,6 +134,14 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder { this.cfg = cfg; } + /** + * Returns the default value for the KEY_AUTO_FONTS value. + * @return the default value + */ + protected boolean getAutoFontsDefault() { + return true; + } + /** * Returns the effective configuration for the transcoder. * @return the effective configuration @@ -142,7 +150,7 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder { Configuration effCfg = this.cfg; if (effCfg == null) { //By default, enable font auto-detection if no cfg is given - boolean autoFonts = true; + boolean autoFonts = getAutoFontsDefault(); if (hints.containsKey(KEY_AUTO_FONTS)) { autoFonts = ((Boolean)hints.get(KEY_AUTO_FONTS)).booleanValue(); } -- 2.39.5