You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ca...@apache.org on 2009/03/31 18:22:28 UTC

svn commit: r760505 - /incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java

Author: carrier
Date: Tue Mar 31 16:22:28 2009
New Revision: 760505

URL: http://svn.apache.org/viewvc?rev=760505&view=rev
Log:
Reverted patch to PDFont.java that was applied in r751664 for PDFBOX-420.  It was causing regression test failures.  The Conversion class changes as part of the patch remain in the trunk, but they are not called

Modified:
    incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java

Modified: incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java
URL: http://svn.apache.org/viewvc/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java?rev=760505&r1=760504&r2=760505&view=diff
==============================================================================
--- incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java (original)
+++ incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java Tue Mar 31 16:22:28 2009
@@ -17,17 +17,17 @@
 package org.apache.pdfbox.pdmodel.font;
 
 import org.fontbox.afm.AFMParser;
+
 import org.fontbox.afm.FontMetric;
+
 import org.fontbox.cmap.CMapParser;
+
 import org.fontbox.cmap.CMap;
-import org.apache.pdfbox.encoding.conversion.EncodingConversionManager;
-import org.apache.pdfbox.encoding.conversion.EncodingConverter;
 
 import org.apache.pdfbox.encoding.AFMEncoding;
 import org.apache.pdfbox.encoding.DictionaryEncoding;
 import org.apache.pdfbox.encoding.Encoding;
 import org.apache.pdfbox.encoding.EncodingManager;
-import org.apache.pdfbox.encoding.conversion.CMapSubstitution;
 
 import org.apache.pdfbox.cos.COSArray;
 import org.apache.pdfbox.cos.COSBase;
@@ -69,7 +69,7 @@
 public abstract class PDFont extends LoggingObject implements COSObjectable
 {
 
-	/**
+    /**
      * The cos dictionary for this font.
      */
     protected COSDictionary font;
@@ -226,7 +226,7 @@
      * @throws IOException If there is an error drawing the specific string.
      */
     public abstract void drawString( String string, Graphics g, float fontSize,
-    	AffineTransform at, float x, float y ) throws IOException;
+        AffineTransform at, float x, float y ) throws IOException;
 
     /**
      * Used for multibyte encodings.
@@ -387,7 +387,6 @@
                         else
                         {
                             String cmapName = encodingName.getName();
-                            cmapName = CMapSubstitution.substituteCMap( cmapName );
                             String resourceRoot = "Resources/cmap/";
                             String resourceName = resourceRoot + cmapName;
                             parseCmap( resourceRoot, ResourceLoader.loadResource( resourceName ), encodingName );
@@ -436,22 +435,6 @@
         {
             retval = cmap.lookup( c, offset, length );
         }
-        COSBase encoding_COS = font.getDictionaryObject(COSName.ENCODING);
-
-        if ( encoding_COS instanceof COSName ) {
-        	EncodingConverter converter = EncodingConversionManager.getConverter(((COSName)encoding_COS).getName());
-
-        	if ( converter != null ) {
-
-        		if ( retval != null )
-        			retval = converter.convertString(retval);
-        		  else
-        			retval = converter.convertBytes(c, offset, length, cmap);
-
-        		return retval;
-        	}
-
-        }
         //if we havn't found a value yet and
         //we are still on the first byte and
         //there is no cmap or the cmap does not have 2 byte mappings then try to encode
@@ -557,9 +540,9 @@
                 }
             }
             /**
-             * Si la cl� /Encoding existe dans le dictionnaire fonte il y a deux possibilit�s :
-             * 1er cas : elle est associ� � une reference contenant un dictionnaire de type encoding.
-             * Ce dictionnaire PDF est repr�sent� par un DictionaryEncoding.
+             * Si la clé /Encoding existe dans le dictionnaire fonte il y a deux possibilités :
+             * 1er cas : elle est associé à une reference contenant un dictionnaire de type encoding.
+             * Ce dictionnaire PDF est représenté par un DictionaryEncoding.
              * If the /Encoding Key does exist in the font dictionary, there are two cases :
              * case one : The value associated with /Encoding is a reference to a dictionary.
              * This dictionary is represented by an instance of DictionaryEncoding class
@@ -572,7 +555,7 @@
                 //file
                 COSName baseEncodingName = (COSName) encodingDic.getDictionaryObject(
                     COSName.BASE_ENCODING);
-                //on ajoute une entr�e /BaseEncoding dans /Encoding uniquement si elle en est absente
+                //on ajoute une entrée /BaseEncoding dans /Encoding uniquement si elle en est absente
                 //if not find in Encoding dictinary target, we try to find it from else where
                 if( baseEncodingName == null)
                 {
@@ -746,8 +729,8 @@
 
         COSName retvalue = null;
         //recuperer le programme de fonte dans son stream qui doit se trouver
-        //dans le flux r�f�renc� par � la cl� FileFont lui m�me situ� dans
-        //le dictionnaire associ� � /FontDescriptor du dictionnaire de type /Font courrant
+        //dans le flux référencé par à la clé FileFont lui même situé dans
+        //le dictionnaire associé à /FontDescriptor du dictionnaire de type /Font courrant
         //get the font program in the stream which should be located in
          //the /FileFont Stream object himself in the /FontDescriptior of the current
         //font dictionary