aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2009-02-16 08:25:25 +0000
committerJeremias Maerki <jeremias@apache.org>2009-02-16 08:25:25 +0000
commitb8f7fb859b3d3b3ddfaec899b402814ab75a29d4 (patch)
treef01f9aca55996d0d4205444c10cf910e2d258566 /src/java/org/apache/fop/render
parent2a40886018161c8be334439447dc1cc10478c606 (diff)
downloadxmlgraphics-fop-b8f7fb859b3d3b3ddfaec899b402814ab75a29d4.tar.gz
xmlgraphics-fop-b8f7fb859b3d3b3ddfaec899b402814ab75a29d4.zip
Added an additional font fallback to PrintRenderer to avoid some problems when processing an intermediate file generated for a different output format than the current one.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign@744856 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render')
-rw-r--r--src/java/org/apache/fop/render/PrintRenderer.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/render/PrintRenderer.java b/src/java/org/apache/fop/render/PrintRenderer.java
index 76f727e84..6e501c199 100644
--- a/src/java/org/apache/fop/render/PrintRenderer.java
+++ b/src/java/org/apache/fop/render/PrintRenderer.java
@@ -24,6 +24,8 @@ import java.awt.geom.Rectangle2D;
import java.util.List;
import java.util.Map;
+import org.w3c.dom.Document;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.area.Area;
import org.apache.fop.area.Trait;
@@ -35,7 +37,6 @@ import org.apache.fop.fonts.FontManager;
import org.apache.fop.fonts.FontResolver;
import org.apache.fop.fonts.FontTriplet;
import org.apache.fop.fonts.base14.Base14FontCollection;
-import org.w3c.dom.Document;
/** Abstract base class of "Print" type renderers. */
public abstract class PrintRenderer extends AbstractRenderer {
@@ -93,7 +94,13 @@ public abstract class PrintRenderer extends AbstractRenderer {
*/
protected String getInternalFontNameForArea(Area area) {
FontTriplet triplet = (FontTriplet)area.getTrait(Trait.FONT);
- return fontInfo.getInternalFontKey(triplet);
+ String key = fontInfo.getInternalFontKey(triplet);
+ if (key == null) {
+ //Find a default fallback font as last resort
+ triplet = new FontTriplet("any", Font.STYLE_NORMAL, Font.WEIGHT_NORMAL);
+ key = fontInfo.getInternalFontKey(triplet);
+ }
+ return key;
}
/**