pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1618535 - in /pdfbox/branches/no-awt: fontbox/src/main/java/org/apache/fontbox/ttf/ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/ pdfbox/src/main/java/org/apache/pdfbox/util/
Date Mon, 18 Aug 2014 02:25:09 GMT
Author: jahewson
Date: Mon Aug 18 02:25:08 2014
New Revision: 1618535

URL: http://svn.apache.org/r1618535
Log:
PDFBOX-2262: Improved debug logging for fonts

Modified:
    pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphRenderer.java
    pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/ExternalFonts.java
    pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
    pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/util/PDFStreamEngine.java

Modified: pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphRenderer.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphRenderer.java?rev=1618535&r1=1618534&r2=1618535&view=diff
==============================================================================
--- pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphRenderer.java
(original)
+++ pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/GlyphRenderer.java
Mon Aug 18 02:25:08 2014
@@ -214,7 +214,7 @@ class GlyphRenderer
         path.closePath();
         if (LOG.isDebugEnabled())
         {
-            LOG.debug("closePath");
+            LOG.trace("closePath");
         }
     }
 
@@ -223,7 +223,7 @@ class GlyphRenderer
         path.moveTo(point.x, point.y);
         if (LOG.isDebugEnabled())
         {
-            LOG.debug("moveTo: " + String.format("%d,%d", point.x, point.y));
+            LOG.trace("moveTo: " + String.format("%d,%d", point.x, point.y));
         }
     }
 
@@ -232,7 +232,7 @@ class GlyphRenderer
         path.lineTo(point.x, point.y);
         if (LOG.isDebugEnabled())
         {
-            LOG.debug("lineTo: " + String.format("%d,%d", point.x, point.y));
+            LOG.trace("lineTo: " + String.format("%d,%d", point.x, point.y));
         }
     }
 
@@ -241,7 +241,7 @@ class GlyphRenderer
         path.quadTo(ctrlPoint.x, ctrlPoint.y, point.x, point.y);
         if (LOG.isDebugEnabled())
         {
-            LOG.debug("quadTo: " + String.format("%d,%d %d,%d", ctrlPoint.x, ctrlPoint.y,
+            LOG.trace("quadTo: " + String.format("%d,%d %d,%d", ctrlPoint.x, ctrlPoint.y,
                     point.x, point.y));
         }
     }

Modified: pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/ExternalFonts.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/ExternalFonts.java?rev=1618535&r1=1618534&r2=1618535&view=diff
==============================================================================
--- pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/ExternalFonts.java
(original)
+++ pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/ExternalFonts.java
Mon Aug 18 02:25:08 2014
@@ -25,6 +25,8 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.fontbox.cff.CFFCIDFont;
 import org.apache.fontbox.cff.CFFFont;
 import org.apache.fontbox.cff.CFFType1Font;
@@ -42,6 +44,7 @@ public final class ExternalFonts
 {
     private ExternalFonts() {}
 
+    private static final Log log = LogFactory.getLog(ExternalFonts.class);
     private static FontProvider fontProvider;
 
     /**

Modified: pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java?rev=1618535&r1=1618534&r2=1618535&view=diff
==============================================================================
--- pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
(original)
+++ pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
Mon Aug 18 02:25:08 2014
@@ -60,9 +60,9 @@ final class FileSystemFontProvider imple
      */
     FileSystemFontProvider()
     {
-        if (LOG.isDebugEnabled())
+        if (LOG.isTraceEnabled())
         {
-            LOG.debug("Will search the local system for fonts");
+            LOG.trace("Will search the local system for fonts");
         }
 
         int count = 0;
@@ -90,9 +90,9 @@ final class FileSystemFontProvider imple
             }
         }
 
-        if (LOG.isDebugEnabled())
+        if (LOG.isTraceEnabled())
         {
-            LOG.debug("Found " + count + " fonts on the local system");
+            LOG.trace("Found " + count + " fonts on the local system");
         }
     }
 
@@ -129,9 +129,9 @@ final class FileSystemFontProvider imple
                     ttfFontFiles.put(psName, otfFile);
                 }
 
-                if (LOG.isDebugEnabled())
+                if (LOG.isTraceEnabled())
                 {
-                    LOG.debug(format +": '" + psName + "' / '" + nameTable.getFontFamily()
+
+                    LOG.trace(format +": '" + psName + "' / '" + nameTable.getFontFamily()
+
                             "' / '" + nameTable.getFontSubFamily() + "'");
                 }
             }
@@ -159,9 +159,9 @@ final class FileSystemFontProvider imple
             String psName = type1.getFontName();
             type1FontFiles.put(psName, pfbFile);
 
-            if (LOG.isDebugEnabled())
+            if (LOG.isTraceEnabled())
             {
-                LOG.debug("PFB: '" + psName + "' / '" + type1.getFamilyName() + "' / '" +
+                LOG.trace("PFB: '" + psName + "' / '" + type1.getFamilyName() + "' / '" +
                         type1.getWeight() + "'");
             }
         }
@@ -188,6 +188,10 @@ final class FileSystemFontProvider imple
             {
                 ttf = ttfParser.parseTTF(file);
                 ttfFonts.put(postScriptName, ttf);
+                if (LOG.isDebugEnabled())
+                {
+                    LOG.debug("Loaded " + postScriptName + " from " + file);
+                }
                 return ttf;
             }
             catch (IOException e)
@@ -218,6 +222,11 @@ final class FileSystemFontProvider imple
                 CFFParser cffParser = new CFFParser();
                 cff = cffParser.parse(bytes).get(0);
                 cffFonts.put(postScriptName, cff);
+                if (LOG.isDebugEnabled())
+                {
+                    LOG.debug("Loaded " + postScriptName + " from " + file);
+                }
+                return cff;
             }
             catch (IOException e)
             {
@@ -249,6 +258,11 @@ final class FileSystemFontProvider imple
                 input = new FileInputStream(file);
                 type1 = Type1Font.createWithPFB(input);
                 type1Fonts.put(postScriptName, type1);
+                if (LOG.isDebugEnabled())
+                {
+                    LOG.debug("Loaded " + postScriptName + " from " + file);
+                }
+                return type1;
             }
             catch (IOException e)
             {

Modified: pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/util/PDFStreamEngine.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/util/PDFStreamEngine.java?rev=1618535&r1=1618534&r2=1618535&view=diff
==============================================================================
--- pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/util/PDFStreamEngine.java
(original)
+++ pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/util/PDFStreamEngine.java
Mon Aug 18 02:25:08 2014
@@ -256,9 +256,9 @@ public class PDFStreamEngine
             while (iter.hasNext())
             {
                 Object next = iter.next();
-                if (LOG.isDebugEnabled())
+                if (LOG.isTraceEnabled())
                 {
-                    LOG.debug("processing substream token: " + next);
+                    LOG.trace("processing substream token: " + next);
                 }
                 if (next instanceof COSObject)
                 {



Mime
View raw message