pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1773460 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
Date Fri, 09 Dec 2016 20:25:38 GMT
Author: tilman
Date: Fri Dec  9 20:25:38 2016
New Revision: 1773460

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

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java?rev=1773460&r1=1773459&r2=1773460&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
Fri Dec  9 20:25:38 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));
 



Mime
View raw message