diff options
author | Tore Engvig <tore@apache.org> | 2001-08-02 19:38:08 +0000 |
---|---|---|
committer | Tore Engvig <tore@apache.org> | 2001-08-02 19:38:08 +0000 |
commit | 684250223cfb31fd9a61dae4493fb31610aeb1c8 (patch) | |
tree | 0a2dea45d0d6984b8d4b022a232df1f12d87dec5 /src | |
parent | e40c992a84dba4bb360cf4cc5a82bcfceed59407 (diff) | |
download | xmlgraphics-fop-684250223cfb31fd9a61dae4493fb31610aeb1c8.tar.gz xmlgraphics-fop-684250223cfb31fd9a61dae4493fb31610aeb1c8.zip |
Submitted by: Struan Judd (struan@sjudd.com)
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
Diffstat (limited to 'src')
-rw-r--r-- | src/org/apache/fop/layout/LineArea.java | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/src/org/apache/fop/layout/LineArea.java b/src/org/apache/fop/layout/LineArea.java index ef16becef..6510e93f9 100644 --- a/src/org/apache/fop/layout/LineArea.java +++ b/src/org/apache/fop/layout/LineArea.java @@ -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; } |