You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2007/11/12 09:27:46 UTC

svn commit: r594046 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java

Author: jeremias
Date: Mon Nov 12 00:27:46 2007
New Revision: 594046

URL: http://svn.apache.org/viewvc?rev=594046&view=rev
Log:
Issue a clear warning if the selected hyphenation character is not available in a font. Otherwise you'd just get a "glyph not available" error and you wonder why the hell FOP wants to use that character.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java?rev=594046&r1=594045&r2=594046&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java Mon Nov 12 00:27:46 2007
@@ -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 @@
         // 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),



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org