From b048fd746595215b7c2f5e85ead6bab0ecf4612d Mon Sep 17 00:00:00 2001 From: fotis Date: Tue, 27 Feb 2001 12:48:59 +0000 Subject: fixed: error if char width = 0 in leader git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194096 13f79535-47bb-0310-9956-ffa450edef68 --- src/org/apache/fop/layout/LineArea.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/org/apache') diff --git a/src/org/apache/fop/layout/LineArea.java b/src/org/apache/fop/layout/LineArea.java index 5f31fed46..5993c79b3 100644 --- a/src/org/apache/fop/layout/LineArea.java +++ b/src/org/apache/fop/layout/LineArea.java @@ -787,8 +787,14 @@ public class LineArea extends Area { * and wraps it in an InlineArea which is returned */ private InlineArea buildSimpleLeader(int charNumber, int leaderLength) { + int width = this.currentFontState.width(charNumber); + if (width == 0) { + char c = (char) charNumber; + MessageHandler.errorln("char " + c + " has width 0. Using width 100 instead."); + width = 100; + } int factor = (int) Math.floor (leaderLength / - this.currentFontState.width(charNumber)); + width); char [] leaderChars = new char [factor]; char fillChar = (char) charNumber; for (int i = 0; i < factor; i ++) { -- cgit v1.2.3