You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2018/03/24 20:29:14 UTC

svn commit: r1827676 - in /pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect: FontFileFinder.java OS400FontDirFinder.java

Author: tilman
Date: Sat Mar 24 20:29:14 2018
New Revision: 1827676

URL: http://svn.apache.org/viewvc?rev=1827676&view=rev
Log:
PDFBOX-4165: support IBM OS/400 font locations

Added:
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/OS400FontDirFinder.java   (with props)
Modified:
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/FontFileFinder.java

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/FontFileFinder.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/FontFileFinder.java?rev=1827676&r1=1827675&r2=1827676&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/FontFileFinder.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/FontFileFinder.java Sat Mar 24 20:29:14 2018
@@ -48,16 +48,17 @@ public class FontFileFinder
         {
             return new WindowsFontDirFinder();
         }
+        else if (osName.startsWith("Mac"))
+        {
+            return new MacFontDirFinder();
+        }
+        else if (osName.startsWith("OS/400"))
+        {
+            return new OS400FontDirFinder();
+        }
         else
         {
-            if (osName.startsWith("Mac"))
-            {
-                return new MacFontDirFinder();
-            }
-            else
-            {
-                return new UnixFontDirFinder();
-            }
+            return new UnixFontDirFinder();
         }
     }
 

Added: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/OS400FontDirFinder.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/OS400FontDirFinder.java?rev=1827676&view=auto
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/OS400FontDirFinder.java (added)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/OS400FontDirFinder.java Sat Mar 24 20:29:14 2018
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2018 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.fontbox.util.autodetect;
+
+/**
+ * Font finder for OS/400 systems.
+ */
+public class OS400FontDirFinder extends NativeFontDirFinder
+{
+    @Override
+    protected String[] getSearchableDirectories()
+    {
+        return new String[] { System.getProperty("user.home") + "/.fonts", // user
+            "/QIBM/ProdData/OS400/Fonts"
+        };
+    }
+}

Propchange: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/util/autodetect/OS400FontDirFinder.java
------------------------------------------------------------------------------
    svn:eol-style = native