pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1649739 - /pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFCIDFont.java
Date Tue, 06 Jan 2015 06:53:11 GMT
Author: jahewson
Date: Tue Jan  6 06:53:11 2015
New Revision: 1649739

URL: http://svn.apache.org/r1649739
Log:
PDFBOX-2495: Check for FontMatrix in Top DICT before falling back to Font DICT

Modified:
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFCIDFont.java

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFCIDFont.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFCIDFont.java?rev=1649739&r1=1649738&r2=1649739&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFCIDFont.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFCIDFont.java Tue Jan  6 06:53:11
2015
@@ -243,8 +243,9 @@ public class CFFCIDFont extends CFFFont
     @Override
     public List<Number> getFontMatrix()
     {
-        // some malformed CIDFonts have their FontMatrix in a Font DICT
-        if (fontDictionaries.size() > 0 && fontDictionaries.get(0).containsKey("FontMatrix"))
+        // some malformed CIDFonts have their FontMatrix in a Font DICT, see PDFBOX-2495
+        if (!topDict.containsKey("FontMatrix") &&
+            fontDictionaries.size() > 0 && fontDictionaries.get(0).containsKey("FontMatrix"))
         {
             return (List<Number>)fontDictionaries.get(0).get("FontMatrix");
         }



Mime
View raw message