diff options
Diffstat (limited to 'src/java/org/apache/fop/render/PrintRenderer.java')
-rw-r--r-- | src/java/org/apache/fop/render/PrintRenderer.java | 11 |
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; } /** |