From: Jeremias Maerki Date: Fri, 5 Dec 2008 09:28:02 +0000 (+0000) Subject: Bugfix: Custom AFP fonts reported bad metrics. X-Git-Tag: fop-1_0~368 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=77c4994e9109551bb7fadc6d06cca501f51766c4;p=xmlgraphics-fop.git Bugfix: Custom AFP fonts reported bad metrics. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@723683 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/afp/fonts/OutlineFont.java b/src/java/org/apache/fop/afp/fonts/OutlineFont.java index 28f2df6c4..ac45a2467 100644 --- a/src/java/org/apache/fop/afp/fonts/OutlineFont.java +++ b/src/java/org/apache/fop/afp/fonts/OutlineFont.java @@ -92,7 +92,7 @@ public class OutlineFont extends AFPFont { * @return the ascender for the given size */ public int getAscender(int size) { - return charSet.getAscender() / 1000 * size; + return charSet.getAscender() * size; } /** @@ -103,7 +103,7 @@ public class OutlineFont extends AFPFont { * @return the cap height for the given size */ public int getCapHeight(int size) { - return charSet.getCapHeight() / 1000 * size; + return charSet.getCapHeight() * size; } /** @@ -116,7 +116,7 @@ public class OutlineFont extends AFPFont { * @return the descender for the given size */ public int getDescender(int size) { - return charSet.getDescender() / 1000 * size; + return charSet.getDescender() * size; } /** @@ -127,7 +127,7 @@ public class OutlineFont extends AFPFont { * @return the x height for the given size */ public int getXHeight(int size) { - return charSet.getXHeight() / 1000 * size; + return charSet.getXHeight() * size; } /** @@ -137,7 +137,7 @@ public class OutlineFont extends AFPFont { * @return the width of the character for the specified point size */ public int getWidth(int character, int size) { - return charSet.getWidth(character) / 1000 * size; + return charSet.getWidth(character) * size; } /** @@ -151,7 +151,7 @@ public class OutlineFont extends AFPFont { public int[] getWidths(int size) { int[] widths = charSet.getWidths(); for (int i = 0; i < widths.length; i++) { - widths[i] = widths[i] / 1000 * size; + widths[i] = widths[i] * size; } return widths; } diff --git a/src/java/org/apache/fop/afp/fonts/RasterFont.java b/src/java/org/apache/fop/afp/fonts/RasterFont.java index c36027913..ddce2d4d5 100644 --- a/src/java/org/apache/fop/afp/fonts/RasterFont.java +++ b/src/java/org/apache/fop/afp/fonts/RasterFont.java @@ -154,7 +154,7 @@ public class RasterFont extends AFPFont { * @return the ascender for the given point size */ public int getAscender(int size) { - return getCharacterSet(size).getAscender(); + return getCharacterSet(size).getAscender() * size; } /** @@ -164,7 +164,7 @@ public class RasterFont extends AFPFont { * @return the cap height for the specified point size */ public int getCapHeight(int size) { - return getCharacterSet(size).getCapHeight(); + return getCharacterSet(size).getCapHeight() * size; } /** @@ -176,7 +176,7 @@ public class RasterFont extends AFPFont { * @return the descender for the specified point size */ public int getDescender(int size) { - return getCharacterSet(size).getDescender(); + return getCharacterSet(size).getDescender() * size; } /** @@ -186,7 +186,7 @@ public class RasterFont extends AFPFont { * @return the x height for the given point size */ public int getXHeight(int size) { - return getCharacterSet(size).getXHeight(); + return getCharacterSet(size).getXHeight() * size; } /** @@ -196,7 +196,7 @@ public class RasterFont extends AFPFont { * @return the width for the given point size */ public int getWidth(int character, int size) { - return getCharacterSet(size).getWidth(character); + return getCharacterSet(size).getWidth(character) * size; } /**