diff options
author | Chris Bowditch <cbowditch@apache.org> | 2009-06-09 09:29:32 +0000 |
---|---|---|
committer | Chris Bowditch <cbowditch@apache.org> | 2009-06-09 09:29:32 +0000 |
commit | 5bde3e055ae41905825ed3b167e453975caa8502 (patch) | |
tree | 56356ec63640d2ede8a64892470ffb67fd12a68b /src/java/org/apache | |
parent | e7975ad2673414f54c5b06a20b836dcd6a33b0fd (diff) | |
download | xmlgraphics-fop-5bde3e055ae41905825ed3b167e453975caa8502.tar.gz xmlgraphics-fop-5bde3e055ae41905825ed3b167e453975caa8502.zip |
bug fix: support PFM Files with no extent table
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@782928 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache')
-rw-r--r-- | src/java/org/apache/fop/fonts/type1/PFMFile.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/fonts/type1/PFMFile.java b/src/java/org/apache/fop/fonts/type1/PFMFile.java index d2d587d90..d1a3d79ff 100644 --- a/src/java/org/apache/fop/fonts/type1/PFMFile.java +++ b/src/java/org/apache/fop/fonts/type1/PFMFile.java @@ -481,7 +481,13 @@ public class PFMFile { * @return The width of a character. */ public int getCharWidth(short which) { - return extentTable[which - dfFirstChar]; + if (extentTable != null) { + return extentTable[which - dfFirstChar]; + } else { + //Fixed-width font (PFM may have no extent table) + //we'll just use the average width + return this.dfAvgWidth; + } } } |