pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1645012 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/ExternalFonts.java
Date Fri, 12 Dec 2014 18:13:35 GMT
Author: jahewson
Date: Fri Dec 12 18:13:35 2014
New Revision: 1645012

URL: http://svn.apache.org/r1645012
Log:
PDFBOX-2557: Heuristic detction of "black" and "heavy" bold fonts

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/ExternalFonts.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/ExternalFonts.java?rev=1645012&r1=1645011&r2=1645012&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/ExternalFonts.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/ExternalFonts.java Fri
Dec 12 18:13:35 2014
@@ -302,7 +302,10 @@ public final class ExternalFonts
             String name = fontDescriptor.getFontName();
             if (name != null)
             {
-                isBold = fontDescriptor.getFontName().toLowerCase().contains("bold");
+                String lower = fontDescriptor.getFontName().toLowerCase();
+                isBold = lower.contains("bold") ||
+                         lower.contains("black") ||
+                         lower.contains("heavy");
             }
 
             // font descriptor flags should describe the style



Mime
View raw message