pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1620713 - in /pdfbox/branches/no-awt: fontbox/src/main/java/org/apache/fontbox/ttf/ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/ pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/ preflight/src/main/java/org/apache/pdfbox/preflig...
Date Tue, 26 Aug 2014 19:44:38 GMT
Author: jahewson
Date: Tue Aug 26 19:44:38 2014
New Revision: 1620713

URL: http://svn.apache.org/r1620713
Log:
PDFBOX-2262: Renamed confusingly named CMAP classes

Added:
    pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/CmapSubtable.java
      - copied, changed from r1619956, pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/CMAPEncodingEntry.java
    pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/CmapTable.java
      - copied, changed from r1619956, pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/CMAPTable.java
Removed:
    pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/CMAPEncodingEntry.java
    pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/CMAPTable.java
Modified:
    pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/TTFParser.java
    pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java
    pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java
    pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java
    pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFont.java
    pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFontEmbedder.java
    pdfbox/branches/no-awt/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestTTFParser.java
    pdfbox/branches/no-awt/preflight/src/main/java/org/apache/pdfbox/preflight/font/container/TrueTypeContainer.java
    pdfbox/branches/no-awt/preflight/src/main/java/org/apache/pdfbox/preflight/font/descriptor/TrueTypeDescriptorHelper.java

Copied: pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/CmapSubtable.java
(from r1619956, pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/CMAPEncodingEntry.java)
URL: http://svn.apache.org/viewvc/pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/CmapSubtable.java?p2=pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/CmapSubtable.java&p1=pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/CMAPEncodingEntry.java&r1=1619956&r2=1620713&rev=1620713&view=diff
==============================================================================
--- pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/CMAPEncodingEntry.java
(original)
+++ pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/CmapSubtable.java
Tue Aug 26 19:44:38 2014
@@ -30,9 +30,9 @@ import org.apache.commons.logging.LogFac
  * 
  * @author Ben Litchfield
  */
-public class CMAPEncodingEntry
+public class CmapSubtable
 {
-    private static final Log LOG = LogFactory.getLog(CMAPEncodingEntry.class);
+    private static final Log LOG = LogFactory.getLog(CmapSubtable.class);
 
     private static final long LEAD_OFFSET = 0xD800 - (0x10000 >> 10);
     private static final long SURROGATE_OFFSET = 0x10000 - (0xD800 << 10) - 0xDC00;
@@ -64,7 +64,7 @@ public class CMAPEncodingEntry
      * @param data The stream to read the data from.
      * @throws IOException If there is an error reading the data.
      */
-    public void initSubtable(CMAPTable cmap, int numGlyphs, TTFDataStream data) throws IOException
+    public void initSubtable(CmapTable cmap, int numGlyphs, TTFDataStream data) throws IOException
     {
         data.seek(cmap.getOffset() + subTableOffset);
         int subtableFormat = data.readUnsignedShort();

Copied: pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/CmapTable.java
(from r1619956, pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/CMAPTable.java)
URL: http://svn.apache.org/viewvc/pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/CmapTable.java?p2=pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/CmapTable.java&p1=pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/CMAPTable.java&r1=1619956&r2=1620713&rev=1620713&view=diff
==============================================================================
--- pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/CMAPTable.java (original)
+++ pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/CmapTable.java Tue
Aug 26 19:44:38 2014
@@ -23,7 +23,7 @@ import java.io.IOException;
  * 
  * @author Ben Litchfield
  */
-public class CMAPTable extends TTFTable
+public class CmapTable extends TTFTable
 {
     /**
      * A tag used to identify this table.
@@ -53,7 +53,7 @@ public class CMAPTable extends TTFTable
     public static final int ENCODING_UNICODE_2_0_BMP = 3;
     public static final int ENCODING_UNICODE_2_0_FULL = 4;
 
-    private CMAPEncodingEntry[] cmaps;
+    private CmapSubtable[] cmaps;
 
     /**
      * This will read the required data from the stream.
@@ -66,10 +66,10 @@ public class CMAPTable extends TTFTable
     {
         int version = data.readUnsignedShort();
         int numberOfTables = data.readUnsignedShort();
-        cmaps = new CMAPEncodingEntry[numberOfTables];
+        cmaps = new CmapSubtable[numberOfTables];
         for (int i = 0; i < numberOfTables; i++)
         {
-            CMAPEncodingEntry cmap = new CMAPEncodingEntry();
+            CmapSubtable cmap = new CmapSubtable();
             cmap.initData(data);
             cmaps[i] = cmap;
         }
@@ -83,7 +83,7 @@ public class CMAPTable extends TTFTable
     /**
      * @return Returns the cmaps.
      */
-    public CMAPEncodingEntry[] getCmaps()
+    public CmapSubtable[] getCmaps()
     {
         return cmaps;
     }
@@ -91,7 +91,7 @@ public class CMAPTable extends TTFTable
     /**
      * @param cmapsValue The cmaps to set.
      */
-    public void setCmaps(CMAPEncodingEntry[] cmapsValue)
+    public void setCmaps(CmapSubtable[] cmapsValue)
     {
         cmaps = cmapsValue;
     }
@@ -99,9 +99,9 @@ public class CMAPTable extends TTFTable
     /**
      * Returns the subtable, if any, for the given platform and encoding.
      */
-    public CMAPEncodingEntry getSubtable(int platformId, int platformEncodingId)
+    public CmapSubtable getSubtable(int platformId, int platformEncodingId)
     {
-        for (CMAPEncodingEntry cmap : cmaps)
+        for (CmapSubtable cmap : cmaps)
         {
             if (cmap.getPlatformId() == platformId &&
                 cmap.getPlatformEncodingId() == platformEncodingId)

Modified: pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/TTFParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/TTFParser.java?rev=1620713&r1=1620712&r2=1620713&view=diff
==============================================================================
--- pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/TTFParser.java (original)
+++ pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/TTFParser.java Tue
Aug 26 19:44:38 2014
@@ -189,7 +189,7 @@ public class TTFParser
         }
 
         // check others mandatory tables
-        if (!isEmbedded && font.getCMAP() == null)
+        if (!isEmbedded && font.getCmap() == null)
         {
             throw new IOException("cmap is mandatory");
         }
@@ -199,9 +199,9 @@ public class TTFParser
     {
         TTFTable retval = null;
         String tag = raf.readString(4);
-        if (tag.equals(CMAPTable.TAG))
+        if (tag.equals(CmapTable.TAG))
         {
-            retval = new CMAPTable();
+            retval = new CmapTable();
         }
         else if (tag.equals(GlyphTable.TAG))
         {

Modified: pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java?rev=1620713&r1=1620712&r2=1620713&view=diff
==============================================================================
--- pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java
(original)
+++ pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/TTFSubsetter.java
Tue Aug 26 19:44:38 2014
@@ -55,7 +55,7 @@ public class TTFSubsetter
     
     private final TrueTypeFont baseTTF;
     private final String nameSuffix;
-    private final CMAPEncodingEntry baseCmap;
+    private final CmapSubtable baseCmap;
     
     // A map of unicode char codes to glyph IDs of the original font.
     private final SortedMap<Integer,Integer> characters;
@@ -77,10 +77,10 @@ public class TTFSubsetter
         characters = new TreeMap<Integer, Integer>();
         glyphIds = new TreeSet<Integer>();
         
-        CMAPEncodingEntry[] cmaps = this.baseTTF.getCMAP().getCmaps();
-        CMAPEncodingEntry unicodeCmap = null;
+        CmapSubtable[] cmaps = this.baseTTF.getCmap().getCmaps();
+        CmapSubtable unicodeCmap = null;
         
-        for (CMAPEncodingEntry cmap : cmaps)
+        for (CmapSubtable cmap : cmaps)
         {
             // take first unicode map.
             if (cmap.getPlatformId() == 0 || (cmap.getPlatformId() == 3 && cmap.getPlatformEncodingId()
== 1)) 

Modified: pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java?rev=1620713&r1=1620712&r2=1620713&view=diff
==============================================================================
--- pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java
(original)
+++ pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java
Tue Aug 26 19:44:38 2014
@@ -252,9 +252,9 @@ public class TrueTypeFont implements Typ
      * 
      * @return The "cmap" table.
      */
-    public CMAPTable getCMAP() throws IOException
+    public CmapTable getCmap() throws IOException
     {
-        CMAPTable cmap = (CMAPTable)tables.get( CMAPTable.TAG );
+        CmapTable cmap = (CmapTable)tables.get( CmapTable.TAG );
         if (cmap != null && !cmap.getInitialized())
         {
             readTable(cmap);

Modified: pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java?rev=1620713&r1=1620712&r2=1620713&view=diff
==============================================================================
--- pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java
(original)
+++ pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java
Tue Aug 26 19:44:38 2014
@@ -22,8 +22,8 @@ import java.io.InputStream;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.fontbox.cmap.CMap;
-import org.apache.fontbox.ttf.CMAPEncodingEntry;
-import org.apache.fontbox.ttf.CMAPTable;
+import org.apache.fontbox.ttf.CmapSubtable;
+import org.apache.fontbox.ttf.CmapTable;
 import org.apache.fontbox.ttf.TTFParser;
 import org.apache.fontbox.ttf.TrueTypeFont;
 import org.apache.pdfbox.cos.COSBase;
@@ -172,7 +172,7 @@ public class PDCIDFontType2 extends PDCI
             // font's 'cmap' table. The means by which this is accomplished are implementation-
             // dependent.
 
-            CMAPEncodingEntry cmap = getUnicodeCmap(ttf.getCMAP());
+            CmapSubtable cmap = getUnicodeCmap(ttf.getCmap());
             String unicode;
 
             // non-symbolic behaviour for Type2 TTFs isn't well documented, test with PDFBOX-1422
@@ -244,26 +244,26 @@ public class PDCIDFontType2 extends PDCI
      * Returns the best Unicode from the font (the most general). The PDF spec says that
"The means
      * by which this is accomplished are implementation-dependent."
      */
-    private CMAPEncodingEntry getUnicodeCmap(CMAPTable cmapTable)
+    private CmapSubtable getUnicodeCmap(CmapTable cmapTable)
     {
-        CMAPEncodingEntry cmap = cmapTable.getSubtable(CMAPTable.PLATFORM_UNICODE,
-                                                  CMAPTable.ENCODING_UNICODE_2_0_FULL);
+        CmapSubtable cmap = cmapTable.getSubtable(CmapTable.PLATFORM_UNICODE,
+                                                  CmapTable.ENCODING_UNICODE_2_0_FULL);
         if (cmap == null)
         {
-            cmap = cmapTable.getSubtable(CMAPTable.PLATFORM_UNICODE,
-                                         CMAPTable.ENCODING_UNICODE_2_0_BMP);
+            cmap = cmapTable.getSubtable(CmapTable.PLATFORM_UNICODE,
+                                         CmapTable.ENCODING_UNICODE_2_0_BMP);
         }
         if (cmap == null)
         {
-            cmap = cmapTable.getSubtable(CMAPTable.PLATFORM_WINDOWS,
-                                         CMAPTable.ENCODING_WIN_UNICODE);
+            cmap = cmapTable.getSubtable(CmapTable.PLATFORM_WINDOWS,
+                                         CmapTable.ENCODING_WIN_UNICODE);
         }
         if (cmap == null)
         {
             // Microsoft's "Recommendations for OpenType Fonts" says that "Symbol" encoding
             // actually means "Unicode, non-standard character set"
-            cmap = cmapTable.getSubtable(CMAPTable.PLATFORM_WINDOWS,
-                                         CMAPTable.ENCODING_WIN_SYMBOL);
+            cmap = cmapTable.getSubtable(CmapTable.PLATFORM_WINDOWS,
+                                         CmapTable.ENCODING_WIN_SYMBOL);
         }
         if (cmap == null)
         {

Modified: pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFont.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFont.java?rev=1620713&r1=1620712&r2=1620713&view=diff
==============================================================================
--- pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFont.java
(original)
+++ pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFont.java
Tue Aug 26 19:44:38 2014
@@ -25,8 +25,8 @@ import java.util.Map;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.fontbox.ttf.CMAPEncodingEntry;
-import org.apache.fontbox.ttf.CMAPTable;
+import org.apache.fontbox.ttf.CmapSubtable;
+import org.apache.fontbox.ttf.CmapTable;
 import org.apache.fontbox.ttf.TTFParser;
 import org.apache.fontbox.ttf.TrueTypeFont;
 import org.apache.pdfbox.cos.COSDictionary;
@@ -72,9 +72,9 @@ public class PDTrueTypeFont extends PDSi
         return new PDTrueTypeFont(doc, new FileInputStream(file));
     }
 
-    private CMAPEncodingEntry cmapWinUnicode = null;
-    private CMAPEncodingEntry cmapWinSymbol = null;
-    private CMAPEncodingEntry cmapMacRoman = null;
+    private CmapSubtable cmapWinUnicode = null;
+    private CmapSubtable cmapWinSymbol = null;
+    private CmapSubtable cmapMacRoman = null;
     private boolean cmapInitialized = false;
 
     private final TrueTypeFont ttf;
@@ -275,27 +275,27 @@ public class PDTrueTypeFont extends PDSi
             return;
         }
 
-        CMAPTable cmapTable = ttf.getCMAP();
+        CmapTable cmapTable = ttf.getCmap();
         if (cmapTable != null)
         {
             // get all relevant "cmap" subtables
-            CMAPEncodingEntry[] cmaps = cmapTable.getCmaps();
-            for (CMAPEncodingEntry cmap : cmaps)
+            CmapSubtable[] cmaps = cmapTable.getCmaps();
+            for (CmapSubtable cmap : cmaps)
             {
-                if (CMAPTable.PLATFORM_WINDOWS == cmap.getPlatformId())
+                if (CmapTable.PLATFORM_WINDOWS == cmap.getPlatformId())
                 {
-                    if (CMAPTable.ENCODING_WIN_UNICODE == cmap.getPlatformEncodingId())
+                    if (CmapTable.ENCODING_WIN_UNICODE == cmap.getPlatformEncodingId())
                     {
                         cmapWinUnicode = cmap;
                     }
-                    else if (CMAPTable.ENCODING_WIN_SYMBOL == cmap.getPlatformEncodingId())
+                    else if (CmapTable.ENCODING_WIN_SYMBOL == cmap.getPlatformEncodingId())
                     {
                         cmapWinSymbol = cmap;
                     }
                 }
-                else if (CMAPTable.PLATFORM_MACINTOSH == cmap.getPlatformId())
+                else if (CmapTable.PLATFORM_MACINTOSH == cmap.getPlatformId())
                 {
-                    if (CMAPTable.ENCODING_MAC_ROMAN == cmap.getPlatformEncodingId())
+                    if (CmapTable.ENCODING_MAC_ROMAN == cmap.getPlatformEncodingId())
                     {
                         cmapMacRoman = cmap;
                     }

Modified: pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFontEmbedder.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFontEmbedder.java?rev=1620713&r1=1620712&r2=1620713&view=diff
==============================================================================
--- pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFontEmbedder.java
(original)
+++ pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFontEmbedder.java
Tue Aug 26 19:44:38 2014
@@ -16,8 +16,8 @@
  */
 package org.apache.pdfbox.pdmodel.font;
 
-import org.apache.fontbox.ttf.CMAPEncodingEntry;
-import org.apache.fontbox.ttf.CMAPTable;
+import org.apache.fontbox.ttf.CmapSubtable;
+import org.apache.fontbox.ttf.CmapTable;
 import org.apache.fontbox.ttf.GlyphData;
 import org.apache.fontbox.ttf.GlyphTable;
 import org.apache.fontbox.ttf.HeaderTable;
@@ -217,25 +217,25 @@ class PDTrueTypeFontEmbedder
         // this is close enough and I am told it doesn't usually get used.
         fd.setStemV(fd.getFontBoundingBox().getWidth() * .13f);
 
-        CMAPTable cmapTable = ttf.getCMAP();
-        CMAPEncodingEntry uniMap = cmapTable.getSubtable(CMAPTable.PLATFORM_UNICODE,
-                CMAPTable.ENCODING_UNICODE_2_0_FULL);
+        CmapTable cmapTable = ttf.getCmap();
+        CmapSubtable uniMap = cmapTable.getSubtable(CmapTable.PLATFORM_UNICODE,
+                CmapTable.ENCODING_UNICODE_2_0_FULL);
         if (uniMap == null)
         {
-            uniMap = cmapTable.getSubtable(CMAPTable.PLATFORM_UNICODE,
-                    CMAPTable.ENCODING_UNICODE_2_0_BMP);
+            uniMap = cmapTable.getSubtable(CmapTable.PLATFORM_UNICODE,
+                    CmapTable.ENCODING_UNICODE_2_0_BMP);
         }
         if (uniMap == null)
         {
-            uniMap = cmapTable.getSubtable(CMAPTable.PLATFORM_WINDOWS,
-                    CMAPTable.ENCODING_WIN_UNICODE);
+            uniMap = cmapTable.getSubtable(CmapTable.PLATFORM_WINDOWS,
+                    CmapTable.ENCODING_WIN_UNICODE);
         }
         if (uniMap == null)
         {
             // Microsoft's "Recommendations for OpenType Fonts" says that "Symbol" encoding
             // actually means "Unicode, non-standard character set"
-            uniMap = cmapTable.getSubtable(CMAPTable.PLATFORM_WINDOWS,
-                    CMAPTable.ENCODING_WIN_SYMBOL);
+            uniMap = cmapTable.getSubtable(CmapTable.PLATFORM_WINDOWS,
+                    CmapTable.ENCODING_WIN_SYMBOL);
         }
         if (uniMap == null)
         {

Modified: pdfbox/branches/no-awt/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestTTFParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/no-awt/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestTTFParser.java?rev=1620713&r1=1620712&r2=1620713&view=diff
==============================================================================
--- pdfbox/branches/no-awt/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestTTFParser.java
(original)
+++ pdfbox/branches/no-awt/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestTTFParser.java
Tue Aug 26 19:44:38 2014
@@ -18,8 +18,8 @@ package org.apache.pdfbox.pdmodel.font;
 
 import java.io.IOException;
 import java.io.InputStream;
-import org.apache.fontbox.ttf.CMAPEncodingEntry;
-import org.apache.fontbox.ttf.CMAPTable;
+import org.apache.fontbox.ttf.CmapSubtable;
+import org.apache.fontbox.ttf.CmapTable;
 import org.apache.fontbox.ttf.NameRecord;
 import org.apache.fontbox.ttf.PostScriptTable;
 import org.apache.fontbox.ttf.TTFParser;
@@ -52,15 +52,15 @@ public class TestTTFParser
 
         TrueTypeFont arial = parser.parseTTF(arialIs);
 
-        CMAPTable cmap = arial.getCMAP();
+        CmapTable cmap = arial.getCmap();
         Assert.assertNotNull(cmap);
 
-        CMAPEncodingEntry[] cmaps = cmap.getCmaps();
+        CmapSubtable[] cmaps = cmap.getCmaps();
         Assert.assertNotNull(cmaps);
 
-        CMAPEncodingEntry uc = null;
+        CmapSubtable uc = null;
 
-        for (CMAPEncodingEntry e : cmaps)
+        for (CmapSubtable e : cmaps)
         {
             if (e.getPlatformId() == NameRecord.PLATFORM_WINDOWS
                     && e.getPlatformEncodingId() == NameRecord.ENCODING_WINDOWS_UNICODE_BMP)

Modified: pdfbox/branches/no-awt/preflight/src/main/java/org/apache/pdfbox/preflight/font/container/TrueTypeContainer.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/no-awt/preflight/src/main/java/org/apache/pdfbox/preflight/font/container/TrueTypeContainer.java?rev=1620713&r1=1620712&r2=1620713&view=diff
==============================================================================
--- pdfbox/branches/no-awt/preflight/src/main/java/org/apache/pdfbox/preflight/font/container/TrueTypeContainer.java
(original)
+++ pdfbox/branches/no-awt/preflight/src/main/java/org/apache/pdfbox/preflight/font/container/TrueTypeContainer.java
Tue Aug 26 19:44:38 2014
@@ -25,8 +25,8 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.fontbox.ttf.CMAPEncodingEntry;
-import org.apache.fontbox.ttf.CMAPTable;
+import org.apache.fontbox.ttf.CmapSubtable;
+import org.apache.fontbox.ttf.CmapTable;
 import org.apache.fontbox.ttf.TrueTypeFont;
 import org.apache.pdfbox.encoding.Encoding;
 import org.apache.pdfbox.encoding.GlyphList;
@@ -37,7 +37,7 @@ import org.apache.pdfbox.preflight.font.
 public class TrueTypeContainer extends FontContainer
 {
     protected TrueTypeFont ttFont;
-    private CMAPEncodingEntry[] cmapEncodingEntries = null;
+    private CmapSubtable[] cmapEncodingEntries = null;
     private PDTrueTypeFont trueTypeFont;
 
     public TrueTypeContainer(PDTrueTypeFont font)
@@ -70,7 +70,7 @@ public class TrueTypeContainer extends F
 
         try
         {
-            CMAPTable cmap = this.ttFont.getCMAP();
+            CmapTable cmap = this.ttFont.getCmap();
             if (this.trueTypeFont.getFontDescriptor().isSymbolic())
             {
                 this.cmapEncodingEntries = cmap.getCmaps();
@@ -86,11 +86,11 @@ public class TrueTypeContainer extends F
         }
     }
 
-    private CMAPEncodingEntry[] orderCMapEntries(CMAPTable cmap)
+    private CmapSubtable[] orderCMapEntries(CmapTable cmap)
     {
-        List<CMAPEncodingEntry> res = new ArrayList<CMAPEncodingEntry>();
+        List<CmapSubtable> res = new ArrayList<CmapSubtable>();
         boolean firstIs31 = false;
-        for (CMAPEncodingEntry cmapEntry : cmap.getCmaps())
+        for (CmapSubtable cmapEntry : cmap.getCmaps())
         {
             // WinAnsi
             if ((cmapEntry.getPlatformId() == 3) && (cmapEntry.getPlatformEncodingId()
== 1))
@@ -117,7 +117,7 @@ public class TrueTypeContainer extends F
                 res.add(cmapEntry);
             }
         }
-        return res.toArray(new CMAPEncodingEntry[res.size()]);
+        return res.toArray(new CmapSubtable[res.size()]);
     }
 
     @Override
@@ -128,7 +128,7 @@ public class TrueTypeContainer extends F
             float result = -1f;
             if (cmapEncodingEntries != null)
             {
-                for (CMAPEncodingEntry entry : cmapEncodingEntries)
+                for (CmapSubtable entry : cmapEncodingEntries)
                 {
                     int glyphID = extractGlyphID(cid, entry);
                     if (glyphID > 0)
@@ -154,7 +154,7 @@ public class TrueTypeContainer extends F
      * @param cmap
      * @return
      */
-    private int extractGlyphID(int cid, CMAPEncodingEntry cmap)
+    private int extractGlyphID(int cid, CmapSubtable cmap)
     {
         int notFoundGlyphID = 0;
 

Modified: pdfbox/branches/no-awt/preflight/src/main/java/org/apache/pdfbox/preflight/font/descriptor/TrueTypeDescriptorHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/no-awt/preflight/src/main/java/org/apache/pdfbox/preflight/font/descriptor/TrueTypeDescriptorHelper.java?rev=1620713&r1=1620712&r2=1620713&view=diff
==============================================================================
--- pdfbox/branches/no-awt/preflight/src/main/java/org/apache/pdfbox/preflight/font/descriptor/TrueTypeDescriptorHelper.java
(original)
+++ pdfbox/branches/no-awt/preflight/src/main/java/org/apache/pdfbox/preflight/font/descriptor/TrueTypeDescriptorHelper.java
Tue Aug 26 19:44:38 2014
@@ -83,7 +83,7 @@ public class TrueTypeDescriptorHelper ex
             bis = new ByteArrayInputStream(fontFile.getByteArray());
             TrueTypeFont ttf = new TTFParser(true).parseTTF(bis);
 
-            if (fontDescriptor.isSymbolic() && ttf.getCMAP().getCmaps().length !=
1)
+            if (fontDescriptor.isSymbolic() && ttf.getCmap().getCmaps().length !=
1)
             {
                 this.fContainer.push(new ValidationError(ERROR_FONTS_ENCODING,
                         "The Encoding should be missing for the Symbolic TTF"));



Mime
View raw message