pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1620714 - in /pdfbox/branches/no-awt: fontbox/src/main/java/org/apache/fontbox/ttf/RAFDataStream.java fontbox/src/main/java/org/apache/fontbox/ttf/TTFParser.java pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
Date Tue, 26 Aug 2014 19:48:23 GMT
Author: jahewson
Date: Tue Aug 26 19:48:23 2014
New Revision: 1620714

URL: http://svn.apache.org/r1620714
Log:
PDFBOX-2262: Remove unused and broken RAFDataStream

Removed:
    pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/RAFDataStream.java
Modified:
    pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/TTFParser.java
    pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java

Modified: pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/TTFParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/TTFParser.java?rev=1620714&r1=1620713&r2=1620714&view=diff
==============================================================================
--- pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/TTFParser.java (original)
+++ pdfbox/branches/no-awt/fontbox/src/main/java/org/apache/fontbox/ttf/TTFParser.java Tue
Aug 26 19:48:23 2014
@@ -17,6 +17,7 @@
 package org.apache.fontbox.ttf;
 
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 
@@ -69,8 +70,7 @@ public class TTFParser
      */
     public TrueTypeFont parseTTF(String ttfFile) throws IOException
     {
-        RAFDataStream raf = new RAFDataStream(ttfFile, "r");
-        return parseTTF(raf);
+        return parseTTF(new File(ttfFile));
     }
 
     /**
@@ -82,8 +82,19 @@ public class TTFParser
      */
     public TrueTypeFont parseTTF(File ttfFile) throws IOException
     {
-        RAFDataStream raf = new RAFDataStream(ttfFile, "r");
-        return parseTTF(raf);
+        InputStream in = null;
+        try
+        {
+            in = new FileInputStream(ttfFile);
+            return parseTTF(in);
+        }
+        finally
+        {
+            if (in != null)
+            {
+                in.close();
+            }
+        }
     }
 
     /**

Modified: pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java?rev=1620714&r1=1620713&r2=1620714&view=diff
==============================================================================
--- pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
(original)
+++ pdfbox/branches/no-awt/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
Tue Aug 26 19:48:23 2014
@@ -188,9 +188,7 @@ final class FileSystemFontProvider imple
             TTFParser ttfParser = new TTFParser(false, true);
             try
             {
-                // fixme: RAFDataStream appears to be broken
-                //ttf = ttfParser.parseTTF(file);
-                ttf = ttfParser.parseTTF(new FileInputStream(file));
+                ttf = ttfParser.parseTTF(file);
 
                 ttfFonts.put(postScriptName, ttf);
                 if (LOG.isDebugEnabled())



Mime
View raw message