From 36f10634df669019906960de6909b0041de17dba Mon Sep 17 00:00:00 2001 From: Bertrand Delacretaz Date: Thu, 21 Sep 2006 12:44:22 +0000 Subject: [PATCH] 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 --- src/java/org/apache/fop/fonts/CustomFont.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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; } /** -- 2.39.5