]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Submitted by: Struan Judd (struan@sjudd.com)
authorTore Engvig <tore@apache.org>
Thu, 2 Aug 2001 19:38:08 +0000 (19:38 +0000)
committerTore Engvig <tore@apache.org>
Thu, 2 Aug 2001 19:38:08 +0000 (19:38 +0000)
Fixes bug that causes character - glyph mapping to occur twice in getWordWidth
method causing overlapping areas.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194389 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/layout/LineArea.java

index ef16becefe66c1fd331edfed38e652dbb2205dc4..6510e93f973b42fb7295815209ed8c095b2b188e 100644 (file)
@@ -989,35 +989,20 @@ public class LineArea extends Area {
         return wordStart;
     }
 
-    /**
-     * Calculates the wordwidth of a string by first mapping the
-     * characteers in the string to glyphs in the current fontstate.
-     */
-    private int getWordWidth(String word) {
-        return getWordWidth(word, true);
-    }
 
     /**
-     * calculates the wordWidth using the actual fontstate
-     * @param doMap if true, map the charaters in the string to glyphs in
-     * the current fontstate before calculating width. If false,
-     * assume that it's already done.
+     * Calculates the wordWidth using the actual fontstate
      */
-    private int getWordWidth(String word, boolean doMap) {
+    private int getWordWidth(String word) {
         if (word == null)
             return 0;
         int wordLength = word.length();
         int width = 0;
         char[] characters = new char[wordLength];
         word.getChars(0, wordLength, characters, 0);
-        char currentChar;
-        for (int i = 0; i < wordLength; i++) {
-            if (doMap)
-                currentChar = currentFontState.mapChar(characters[i]);
-            else
-                currentChar = characters[i];
 
-            width += getCharWidth(currentChar);
+        for (int i = 0; i < wordLength; i++) {
+            width += getCharWidth(characters[i]);
         }
         return width;
     }