pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1602072 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
Date Thu, 12 Jun 2014 06:47:29 GMT
Author: tilman
Date: Thu Jun 12 06:47:29 2014
New Revision: 1602072

URL: http://svn.apache.org/r1602072
Log:
PDFBOX-239: add mapping method where name != AFM filename, and map Arial to the Helvetica
AFM

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java?rev=1602072&r1=1602071&r2=1602072&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java Thu
Jun 12 06:47:29 2014
@@ -162,6 +162,13 @@ public class PDType1Font extends PDSimpl
         addAdobeFontMetric(metrics, "Times-Italic");
         addAdobeFontMetric(metrics, "Times-Roman");
         addAdobeFontMetric(metrics, "ZapfDingbats");
+        
+        // PDFBOX-239
+        addAdobeFontMetric(metrics, "Arial", "Helvetica");
+        addAdobeFontMetric(metrics, "Arial,Bold", "Helvetica-Bold");
+        addAdobeFontMetric(metrics, "Arial,Italic", "Helvetica-Oblique");
+        addAdobeFontMetric(metrics, "Arial,BoldItalic", "Helvetica-BoldOblique");
+
         return metrics;
     }
 
@@ -169,9 +176,14 @@ public class PDType1Font extends PDSimpl
 
     private static void addAdobeFontMetric(Map<String, FontMetric> metrics, String
name)
     {
+        addAdobeFontMetric(metrics, name, name);
+    }
+    
+    private static void addAdobeFontMetric(Map<String, FontMetric> metrics, String
name, String filePrefix)
+    {
         try
         {
-            String resource = resourceRootAFM + name + ".afm";
+            String resource = resourceRootAFM + filePrefix + ".afm";
             InputStream afmStream = ResourceLoader.loadResource(resource);
             if (afmStream != null)
             {



Mime
View raw message