pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1798242 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/TrueTypeEmbedder.java
Date Fri, 09 Jun 2017 16:03:23 GMT
Author: tilman
Date: Fri Jun  9 16:03:23 2017
New Revision: 1798242

URL: http://svn.apache.org/viewvc?rev=1798242&view=rev
Log:
PDFBOX-3824: don't embed full font when subsetting

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/TrueTypeEmbedder.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/TrueTypeEmbedder.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/TrueTypeEmbedder.java?rev=1798242&r1=1798241&r2=1798242&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/TrueTypeEmbedder.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/TrueTypeEmbedder.java
Fri Jun  9 16:03:23 2017
@@ -88,9 +88,13 @@ abstract class TrueTypeEmbedder implemen
         this.ttf = ttf;
         fontDescriptor = createFontDescriptor(ttf);
 
-        PDStream stream = new PDStream(document, ttf.getOriginalData(), COSName.FLATE_DECODE);
-        stream.getCOSObject().setInt(COSName.LENGTH1, stream.toByteArray().length);
-        fontDescriptor.setFontFile2(stream);
+        if (!embedSubset)
+        {
+            // full embedding
+            PDStream stream = new PDStream(document, ttf.getOriginalData(), COSName.FLATE_DECODE);
+            stream.getCOSObject().setInt(COSName.LENGTH1, stream.toByteArray().length);
+            fontDescriptor.setFontFile2(stream);
+        }
 
         dict.setName(COSName.BASE_FONT, ttf.getName());
 



Mime
View raw message