From cfd456f554e0e0d89d8455f9d216850a0cc1765b Mon Sep 17 00:00:00 2001 From: Mehdi Houshmand Date: Mon, 23 Jan 2012 12:08:08 +0000 Subject: [PATCH] Bugzilla#52499: non embeddable TTF fonts -- throw exception if trying to embed Submitted by: Luis Bernardo git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1234761 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/fonts/truetype/TTFFontLoader.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java b/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java index dc2bec352..d1a55dd20 100644 --- a/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java +++ b/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java @@ -169,8 +169,13 @@ public class TTFFontLoader extends FontLoader { if (useKerning) { copyKerning(ttf, isCid); } - if (this.embedded && ttf.isEmbeddable()) { - returnFont.setEmbedFileName(this.fontFileURI); + if (this.embedded) { + if (ttf.isEmbeddable()) { + returnFont.setEmbedFileName(this.fontFileURI); + } else { + String msg = "The font " + this.fontFileURI + " is not embedabble."; + throw new RuntimeException(msg); + } } } -- 2.39.5