pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1602092 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java
Date Thu, 12 Jun 2014 08:18:22 GMT
Author: tilman
Date: Thu Jun 12 08:18:22 2014
New Revision: 1602092

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

Modified:
    pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java?rev=1602092&r1=1602091&r2=1602092&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java (original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java Thu
Jun 12 08:18:22 2014
@@ -133,6 +133,13 @@ public abstract class PDFont implements 
         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;
     }
 
@@ -142,9 +149,14 @@ public abstract class PDFont implements 
     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