pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1863038 - /pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1CFont.java
Date Sun, 14 Jul 2019 07:09:29 GMT
Author: tilman
Date: Sun Jul 14 07:09:29 2019
New Revision: 1863038

URL: http://svn.apache.org/viewvc?rev=1863038&view=rev
Log:
PDFBOX-4595: fix bug that returned 0 instead of cache value, as suggested by Zhichao Yang

Modified:
    pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1CFont.java

Modified: pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1CFont.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1CFont.java?rev=1863038&r1=1863037&r2=1863038&view=diff
==============================================================================
--- pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1CFont.java
(original)
+++ pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1CFont.java
Sun Jul 14 07:09:29 2019
@@ -301,12 +301,16 @@ public class PDType1CFont extends PDSimp
     public float getHeight(int code) throws IOException
     {
         String name = codeToName(code);
-        float height = 0;
+        float height;
         if (!glyphHeights.containsKey(name))
         {
             height = (float)cffFont.getType1CharString(name).getBounds().getHeight(); //
todo: cffFont could be null
             glyphHeights.put(name, height);
         }
+        else
+        {
+            height = glyphHeights.get(name);
+        }
         return height;
     }
 



Mime
View raw message