From 684250223cfb31fd9a61dae4493fb31610aeb1c8 Mon Sep 17 00:00:00 2001 From: Tore Engvig Date: Thu, 2 Aug 2001 19:38:08 +0000 Subject: [PATCH] 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 --- src/org/apache/fop/layout/LineArea.java | 23 ++++------------------- 1 file 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; } -- 2.39.5