]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Better error message if a font is missing when generating PS from IF.
authorJeremias Maerki <jeremias@apache.org>
Wed, 10 Feb 2010 09:31:42 +0000 (09:31 +0000)
committerJeremias Maerki <jeremias@apache.org>
Wed, 10 Feb 2010 09:31:42 +0000 (09:31 +0000)
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

src/java/org/apache/fop/cli/IFInputHandler.java
src/java/org/apache/fop/render/ps/PSPainter.java

index 4a67f522f3a67c43b8d5564bbbc9863639178789..6b4031a27d412d05c90dba55fcbba5fd58d5d417 100644 (file)
@@ -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();
index 051013a63f32673d07c2b0a3f564f5ebc928aeb4..38b76fd8a76506bdd34d41157d2ade210b684829 100644 (file)
@@ -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