From 57757c4542b5b24daba7119037127debd1c0f749 Mon Sep 17 00:00:00 2001 From: Peter Bernard West Date: Tue, 16 Mar 2004 12:02:37 +0000 Subject: [PATCH] Assume getAscent bug is now fixed git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197453 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/render/awt/AWTFontMetrics.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/java/org/apache/fop/render/awt/AWTFontMetrics.java b/src/java/org/apache/fop/render/awt/AWTFontMetrics.java index 928e4032c..af5adc8b1 100644 --- a/src/java/org/apache/fop/render/awt/AWTFontMetrics.java +++ b/src/java/org/apache/fop/render/awt/AWTFontMetrics.java @@ -111,13 +111,13 @@ public class AWTFontMetrics { */ public int getAscender(String family, int style, int size) { setFont(family, style, size); - // return (int)(FONT_FACTOR * fmt.getAscent()); + return FONT_FACTOR * fmt.getAscent(); - // workaround for sun bug on FontMetrics.getAscent() - // http://developer.java.sun.com/developer/bugParade/bugs/4399887.html - int realAscent = fmt.getAscent() - - (fmt.getDescent() + fmt.getLeading()); - return FONT_FACTOR * realAscent; +// // workaround for sun bug on FontMetrics.getAscent() +// // http://developer.java.sun.com/developer/bugParade/bugs/4399887.html +// int realAscent = fmt.getAscent() +// - (fmt.getDescent() + fmt.getLeading()); +// return FONT_FACTOR * realAscent; } @@ -175,6 +175,7 @@ public class AWTFontMetrics { // the output seems to look a little better if the // space is rendered larger than given by // the FontMetrics object + // TODO find out why if (i <= 32) { w = (int)(1.4 * fmt.charWidth(i) * FONT_FACTOR); } else { -- 2.39.5