pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1763883 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Embedder.java
Date Sat, 08 Oct 2016 09:44:45 GMT
Author: lehmi
Date: Sat Oct  8 09:44:45 2016
New Revision: 1763883

URL: http://svn.apache.org/viewvc?rev=1763883&view=rev
Log:
PDFBOX-3300: reverted some of the former optimizations as the widths are needed in getStringWidth
so that those have to be created at beginning as be overwritten when subsetting the font at
the end

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Embedder.java
  (contents, props changed)

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Embedder.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Embedder.java?rev=1763883&r1=1763882&r2=1763883&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Embedder.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Embedder.java
Sat Oct  8 09:44:45 2016
@@ -73,7 +73,7 @@ final class PDCIDFontType2Embedder exten
         dict.setItem(COSName.ENCODING, COSName.IDENTITY_H); // CID = GID
 
         // descendant CIDFont
-        cidFont = createCIDFont(embedSubset);
+        cidFont = createCIDFont();
         COSArray descendantFonts = new COSArray();
         descendantFonts.add(cidFont);
         dict.setItem(COSName.DESCENDANT_FONTS, descendantFonts);
@@ -108,7 +108,6 @@ final class PDCIDFontType2Embedder exten
         buildWidths(cidToGid);
         buildCIDToGIDMap(cidToGid);
         buildCIDSet(cidToGid);
-        buildToUnicodeCMap(gidToCid);
     }
 
     private void buildToUnicodeCMap(Map<Integer, Integer> newGIDToOldCID) throws IOException
@@ -177,7 +176,7 @@ final class PDCIDFontType2Embedder exten
         return info;
     }
 
-    private COSDictionary createCIDFont(boolean embedSubset) throws IOException
+    private COSDictionary createCIDFont() throws IOException
     {
         COSDictionary cidFont = new COSDictionary();
 
@@ -196,12 +195,7 @@ final class PDCIDFontType2Embedder exten
         cidFont.setItem(COSName.FONT_DESC, fontDescriptor.getCOSObject());
 
         // W - widths
-        if (!embedSubset)
-        {
-            // subsetted fonts have a reduced amount of widths
-            // and will be created after subsetting
-            buildWidths(cidFont);
-        }
+        buildWidths(cidFont);
 
         // CIDToGIDMap
         cidFont.setItem(COSName.CID_TO_GID_MAP, COSName.IDENTITY);

Propchange: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Embedder.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Sat Oct  8 09:44:45 2016
@@ -0,0 +1,3 @@
+/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Embedder.java:1760418,1761484,1762133,1762140,1763609,1763882
+/pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Embedder.java:1618517-1621410
+/pdfbox/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Embedder.java:1618514-1618516



Mime
View raw message