]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
FOP-2491: Adobe Reader error with OTF subset PDF
authorSimon Steiner <ssteiner@apache.org>
Wed, 12 Aug 2015 14:12:59 +0000 (14:12 +0000)
committerSimon Steiner <ssteiner@apache.org>
Wed, 12 Aug 2015 14:12:59 +0000 (14:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1695526 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java

index d8ed13526a9b577ba8eef81f1c0349fa19b90d3c..2c083add296826ee81ec6c465521a2e9c10b1642 100644 (file)
@@ -490,9 +490,13 @@ public class OTFSubSetFile extends OTFFile {
             privateDictOffsets.add(privateDictOffset);
             byte[] fdPrivateDictByteData = curFDFont.getPrivateDictData();
             if (fdPrivateDict.get("Subrs") != null) {
+                int encodingValue = 0;
+                if (fdPrivateDict.get("Subrs").getOperandLength() == 1) {
+                    encodingValue = 139;
+                }
                 fdPrivateDictByteData = updateOffset(fdPrivateDictByteData, fdPrivateDict.get("Subrs").getOffset(),
                         fdPrivateDict.get("Subrs").getOperandLength(),
-                        fdPrivateDictByteData.length);
+                        fdPrivateDictByteData.length + encodingValue);
             }
             writeBytes(fdPrivateDictByteData);
             writeIndex(fdSubrs.get(i));