]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Issue a clear warning if the selected hyphenation character is not available in a...
authorJeremias Maerki <jeremias@apache.org>
Mon, 12 Nov 2007 08:27:46 +0000 (08:27 +0000)
committerJeremias Maerki <jeremias@apache.org>
Mon, 12 Nov 2007 08:27:46 +0000 (08:27 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@594046 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java

index e62f3dc2a0f50b994867c02229dbc42ab7fe707f..d446e0e7d592d12127dc75d7a96250cbb2183cd6 100644 (file)
@@ -20,8 +20,8 @@
 package org.apache.fop.layoutmgr.inline;
 
 import java.util.ArrayList;
-import java.util.List;
 import java.util.LinkedList;
+import java.util.List;
 import java.util.ListIterator;
 
 import org.apache.commons.logging.Log;
@@ -195,7 +195,13 @@ public class TextLayoutManager extends LeafNodeLayoutManager {
         // With CID fonts, space isn't neccesary currentFontState.width(32)
         spaceCharIPD = font.getCharWidth(' ');
         // Use hyphenationChar property
-        hyphIPD = font.getCharWidth(foText.getCommonHyphenation().hyphenationCharacter.getCharacter());
+        char hyphChar = foText.getCommonHyphenation().hyphenationCharacter.getCharacter();
+        if (font.hasChar(hyphChar)) {
+            hyphIPD = font.getCharWidth(hyphChar);
+        } else {
+            log.warn("Hyphenation character 0x" + Integer.toHexString(hyphChar)
+                    + " is not available for font: " + font.getFontTriplet());
+        }
         
         SpaceVal ls = SpaceVal.makeLetterSpacing(foText.getLetterSpacing());
         halfLS = new SpaceVal(MinOptMax.multiply(ls.getSpace(), 0.5),