You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2014/11/22 15:45:34 UTC

svn commit: r1641073 - /pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/descriptor/FontDescriptorHelper.java

Author: tilman
Date: Sat Nov 22 14:45:34 2014
New Revision: 1641073

URL: http://svn.apache.org/r1641073
Log:
PDFBOX-1864: check whether font is embedded even if checkMandadoryFields has failed

Modified:
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/descriptor/FontDescriptorHelper.java

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/descriptor/FontDescriptorHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/descriptor/FontDescriptorHelper.java?rev=1641073&r1=1641072&r2=1641073&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/descriptor/FontDescriptorHelper.java (original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/descriptor/FontDescriptorHelper.java Sat Nov 22 14:45:34 2014
@@ -93,30 +93,31 @@ public abstract class FontDescriptorHelp
         {
             fontDescriptor = fd;
 
-            if (isStandard14 || checkMandatoryFields(fontDescriptor.getCOSObject()))
+            if (!isStandard14)
             {
-                if (hasOnlyOneFontFile(fontDescriptor))
+                checkMandatoryFields(fontDescriptor.getCOSObject());
+            }
+            if (hasOnlyOneFontFile(fontDescriptor))
+            {
+                PDStream fontFile = extractFontFile(fontDescriptor);
+                if (fontFile != null)
                 {
-                    PDStream fontFile = extractFontFile(fontDescriptor);
-                    if (fontFile != null)
-                    {
-                        processFontFile(fontDescriptor, fontFile);
-                        checkFontFileMetaData(fontDescriptor, fontFile);
-                    }
+                    processFontFile(fontDescriptor, fontFile);
+                    checkFontFileMetaData(fontDescriptor, fontFile);
+                }
+            }
+            else
+            {
+                if (fontFileNotEmbedded(fontDescriptor))
+                {
+                    this.fContainer.push(new ValidationError(ERROR_FONTS_FONT_FILEX_INVALID,
+                        fontDescriptor.getFontName() + ": FontFile entry is missing from FontDescriptor"));
+                    this.fContainer.notEmbedded();
                 }
                 else
                 {
-                    if (fontFileNotEmbedded(fontDescriptor))
-                    {
-                        this.fContainer.push(new ValidationError(ERROR_FONTS_FONT_FILEX_INVALID,
-                            fontDescriptor.getFontName() + ": FontFile entry is missing from FontDescriptor"));
-                        this.fContainer.notEmbedded();
-                    }
-                    else
-                    {
-                        this.fContainer.push(new ValidationError(ERROR_FONTS_FONT_FILEX_INVALID,
-                            fontDescriptor.getFontName() + ": They is more than one FontFile"));
-                    }
+                    this.fContainer.push(new ValidationError(ERROR_FONTS_FONT_FILEX_INVALID,
+                        fontDescriptor.getFontName() + ": They is more than one FontFile"));
                 }
             }
         }