From: Bertrand Delacretaz Date: Thu, 21 Sep 2006 12:44:22 +0000 (+0000) Subject: Fix bug #40569: throw IOException when embed-url was specified for an embedded font... X-Git-Tag: fop-0_93~80 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=36f10634df669019906960de6909b0041de17dba;p=xmlgraphics-fop.git Fix bug #40569: throw IOException when embed-url was specified for an embedded font, but Source cannot be found git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@448536 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/fonts/CustomFont.java b/src/java/org/apache/fop/fonts/CustomFont.java index ec266ecc4..8f21a449d 100644 --- a/src/java/org/apache/fop/fonts/CustomFont.java +++ b/src/java/org/apache/fop/fonts/CustomFont.java @@ -19,6 +19,7 @@ package org.apache.fop.fonts; +import java.io.IOException; import java.util.Map; import javax.xml.transform.Source; @@ -69,14 +70,16 @@ public abstract class CustomFont extends Typeface /** * Returns a Source representing an embeddable font file. - * @return Source for an embeddable font file or null if not available. + * @return Source for an embeddable font file + * @throws IOException if embedFileName is not null but Source is not found */ - public Source getEmbedFileSource() { + public Source getEmbedFileSource() throws IOException { + Source result = null; if (resolver != null && embedFileName != null) { - return resolver.resolve(embedFileName); - } else { - return null; + result = resolver.resolve(embedFileName); + if(result == null) throw new IOException("Unable to resolve Source '" + embedFileName + "' for embedded font"); } + return result; } /**