aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2010-02-10 09:31:42 +0000
committerJeremias Maerki <jeremias@apache.org>2010-02-10 09:31:42 +0000
commitced8c4f0eeb7f8ad4517c6e96ffddc432851f23a (patch)
tree517c9cb990b477c6ea3814f4a40d5c20429fc0ea /src
parenta2f1110c29a270ca28d130f65b8109b3c2cb5d71 (diff)
downloadxmlgraphics-fop-ced8c4f0eeb7f8ad4517c6e96ffddc432851f23a.tar.gz
xmlgraphics-fop-ced8c4f0eeb7f8ad4517c6e96ffddc432851f23a.zip
Better error message if a font is missing when generating PS from IF.
Tie font configuration into -ifin parameter on the command-line. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@908410 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/cli/IFInputHandler.java4
-rw-r--r--src/java/org/apache/fop/render/ps/PSPainter.java3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/cli/IFInputHandler.java b/src/java/org/apache/fop/cli/IFInputHandler.java
index 4a67f522f..6b4031a27 100644
--- a/src/java/org/apache/fop/cli/IFInputHandler.java
+++ b/src/java/org/apache/fop/cli/IFInputHandler.java
@@ -29,10 +29,10 @@ import javax.xml.transform.stream.StreamResult;
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
-import org.apache.fop.fonts.FontInfo;
import org.apache.fop.render.intermediate.IFDocumentHandler;
import org.apache.fop.render.intermediate.IFException;
import org.apache.fop.render.intermediate.IFParser;
+import org.apache.fop.render.intermediate.IFUtil;
/**
* InputHandler for the intermediate format XML as input.
@@ -66,7 +66,7 @@ public class IFInputHandler extends InputHandler {
userAgent, outputFormat);
try {
documentHandler.setResult(new StreamResult(out));
- documentHandler.setDefaultFontInfo(new FontInfo());
+ IFUtil.setupFonts(documentHandler);
//Create IF parser
IFParser parser = new IFParser();
diff --git a/src/java/org/apache/fop/render/ps/PSPainter.java b/src/java/org/apache/fop/render/ps/PSPainter.java
index 051013a63..38b76fd8a 100644
--- a/src/java/org/apache/fop/render/ps/PSPainter.java
+++ b/src/java/org/apache/fop/render/ps/PSPainter.java
@@ -349,6 +349,9 @@ public class PSPainter extends AbstractIFPainter {
//TODO Ignored: state.getFontVariant()
//TODO Opportunity for font caching if font state is more heavily used
String fontKey = getFontInfo().getInternalFontKey(triplet);
+ if (fontKey == null) {
+ throw new IFException("Font not available: " + triplet, null);
+ }
int sizeMillipoints = state.getFontSize();
// This assumes that *all* CIDFonts use a /ToUnicode mapping