Author: jeremias
Date: Fri Dec  5 01:28:02 2008
New Revision: 723683

URL: http://svn.apache.org/viewvc?rev=723683&view=rev
Log:
Bugfix: Custom AFP fonts reported bad metrics.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/OutlineFont.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/RasterFont.java

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/OutlineFont.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/OutlineFont.java?rev=723683&r1=723682&r2=723683&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/OutlineFont.java 
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/OutlineFont.java 
Fri Dec  5 01:28:02 2008
@@ -92,7 +92,7 @@
      * @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 @@
      * @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 @@
      * @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 @@
      * @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 @@
      * @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 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;
     }

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/RasterFont.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/RasterFont.java?rev=723683&r1=723682&r2=723683&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/RasterFont.java 
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/RasterFont.java Fri 
Dec  5 01:28:02 2008
@@ -154,7 +154,7 @@
      * @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 @@
      * @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 @@
      * @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 @@
      * @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 @@
      * @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;
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to