pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1627108 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/encoding/GlyphList.java
Date Tue, 23 Sep 2014 18:11:41 GMT
Author: jahewson
Date: Tue Sep 23 18:11:41 2014
New Revision: 1627108

URL: http://svn.apache.org/r1627108
Log:
PDFBOX-2379: Removed support for glyphlist_ext property

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/encoding/GlyphList.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/encoding/GlyphList.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/encoding/GlyphList.java?rev=1627108&r1=1627107&r2=1627108&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/encoding/GlyphList.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/encoding/GlyphList.java Tue Sep 23
18:11:41 2014
@@ -57,11 +57,9 @@ public class GlyphList
                 String location = System.getProperty("glyphlist_ext");
                 if (location != null)
                 {
-                    File external = new File(location);
-                    if (external.exists())
-                    {
-                        DEFAULT.loadGlyphs(location);
-                    }
+                    // not supported in 2.0, see PDFBOX-2379
+                    throw new UnsupportedOperationException("glyphlist_ext is no longer supported,
" +
+                      "use GlyphList.DEFAULT.addGlyphs(Properties) instead");
                 }
             }
             catch (SecurityException e)  // can occur on System.getProperty
@@ -97,7 +95,17 @@ public class GlyphList
 
         Properties properties = new Properties();
         properties.load(url.openStream());
+        addGlyphs(properties);
+    }
 
+    /**
+     * Adds a glyph list stored in a .properties file to this GlyphList.
+     *
+     * @param properties Glyphlist in the form Name=XXXX where X is Unicode hex.
+     * @throws IOException if the properties could not be read
+     */
+    public synchronized void addGlyphs(Properties properties) throws IOException
+    {
         Enumeration<?> names = properties.propertyNames();
         for (Object name : Collections.list(names))
         {



Mime
View raw message