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 2016/12/09 20:26:42 UTC

svn commit: r1773461 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java

Author: tilman
Date: Fri Dec  9 20:26:42 2016
New Revision: 1773461

URL: http://svn.apache.org/viewvc?rev=1773461&view=rev
Log:
PDFBOX-3607: skip fonts with pipe in the name

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java?rev=1773461&r1=1773460&r2=1773461&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java Fri Dec  9 20:26:42 2016
@@ -536,7 +536,12 @@ final class FileSystemFontProvider exten
         try
         {
             // read PostScript name, if any
-            if (ttf.getName() != null)
+            if (ttf.getName() != null && ttf.getName().contains("|"))
+            {
+                fontInfoList.add(new FSIgnored(file, FontFormat.TTF, "*skippipeinname*"));
+                LOG.warn("Skipping font with '|' in name " + ttf.getName() + " in file " + file);
+            }
+            else if (ttf.getName() != null)
             {
                 // ignore bitmap fonts
                 if (ttf.getHeader() == null)
@@ -640,6 +645,12 @@ final class FileSystemFontProvider exten
         try
         {
             Type1Font type1 = Type1Font.createWithPFB(input);
+            if (type1.getName() != null && type1.getName().contains("|"))
+            {
+                fontInfoList.add(new FSIgnored(pfbFile, FontFormat.PFB, "*skippipeinname*"));
+                LOG.warn("Skipping font with '|' in name " + type1.getName() + " in file " + pfbFile);
+                return;
+            }
             fontInfoList.add(new FSFontInfo(pfbFile, FontFormat.PFB, type1.getName(),
                                             null, -1, -1, 0, 0, -1, null, this));