You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by sp...@apache.org on 2010/11/26 19:37:40 UTC

svn commit: r1039502 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts: ./ autodetect/ truetype/

Author: spepping
Date: Fri Nov 26 18:37:40 2010
New Revision: 1039502

URL: http://svn.apache.org/viewvc?rev=1039502&view=rev
Log:
Second part of patch 50245 by Mehdi Houshmand

Added:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontDirFinder.java   (with props)
Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontAdder.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontDetector.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontInfoConfigurator.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontFileFinder.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontFinder.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/NativeFontDirFinder.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/WindowsFontDirFinder.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/truetype/TTFFile.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontAdder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontAdder.java?rev=1039502&r1=1039501&r2=1039502&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontAdder.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontAdder.java Fri Nov 26 18:37:40 2010
@@ -20,7 +20,6 @@
 package org.apache.fop.fonts;
 
 import java.net.URL;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.fop.fonts.autodetect.FontInfoFinder;
@@ -29,9 +28,9 @@ import org.apache.fop.fonts.autodetect.F
  * Adds a list of fonts to a given font info list
  */
 public class FontAdder {
-    private FontEventListener listener;
-    private FontResolver resolver;
-    private FontManager manager;
+    private final FontEventListener listener;
+    private final FontResolver resolver;
+    private final FontManager manager;
 
     /**
      * Main constructor
@@ -50,14 +49,13 @@ public class FontAdder {
      * @param fontURLList font file list
      * @param fontInfoList a configured font info list
      */
-    public void add(List/*<URL>*/ fontURLList, List/*<EmbedFontInfo>*/ fontInfoList) {
+    public void add(List<URL> fontURLList, List<EmbedFontInfo> fontInfoList) {
         FontCache cache = manager.getFontCache();
         FontInfoFinder finder = new FontInfoFinder();
         finder.setEventListener(listener);
 
-        for (Iterator iter = fontURLList.iterator(); iter.hasNext();) {
-            URL fontUrl = (URL)iter.next();
-            EmbedFontInfo[] embedFontInfos = finder.find(fontUrl, resolver, cache);
+        for (URL fontURL : fontURLList) {
+            EmbedFontInfo[] embedFontInfos = finder.find(fontURL, resolver, cache);
             if (embedFontInfos == null) {
                 continue;
             }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontDetector.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontDetector.java?rev=1039502&r1=1039501&r2=1039502&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontDetector.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontDetector.java Fri Nov 26 18:37:40 2010
@@ -42,9 +42,9 @@ public class FontDetector {
         "application/x-font", "application/x-font-truetype"
     };
 
-    private FontManager fontManager;
-    private FontAdder fontAdder;
-    private boolean strict;
+    private final FontManager fontManager;
+    private final FontAdder fontAdder;
+    private final boolean strict;
 
     /**
      * Main constructor
@@ -72,8 +72,7 @@ public class FontDetector {
             try {
                 File fontBase = FileUtils.toFile(new URL(fontBaseURL));
                 if (fontBase != null) {
-                    List/*<URL>*/ fontURLList = fontFileFinder.find(
-                            fontBase.getAbsolutePath());
+                    List<URL> fontURLList = fontFileFinder.find(fontBase.getAbsolutePath());
                     fontAdder.add(fontURLList, fontInfoList);
 
                     //Can only use the font base URL if it's a file URL
@@ -84,7 +83,7 @@ public class FontDetector {
         }
 
         // native o/s font directory finding
-        List/*<URL>*/ systemFontList;
+        List<URL> systemFontList;
         try {
             systemFontList = fontFileFinder.find();
             fontAdder.add(systemFontList, fontInfoList);

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontInfoConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontInfoConfigurator.java?rev=1039502&r1=1039501&r2=1039502&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontInfoConfigurator.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/FontInfoConfigurator.java Fri Nov 26 18:37:40 2010
@@ -140,7 +140,7 @@ public class FontInfoConfigurator {
 
             // add fonts found in directory
             FontFileFinder fontFileFinder = new FontFileFinder(recursive ? -1 : 1);
-            List/*<URL>*/ fontURLList;
+            List<URL> fontURLList;
             try {
                 fontURLList = fontFileFinder.find(directory);
                 fontAdder.add(fontURLList, fontInfoList);
@@ -228,25 +228,23 @@ public class FontInfoConfigurator {
             LogUtil.handleError(log, "font without font-triplet", strict);
 
             File fontFile = FontCache.getFileFromUrls(new String[] {embedUrl, metricsUrl});
-            URL fontUrl;
+            URL fontURL = null;
             try {
-                fontUrl = fontFile.toURI().toURL();
+                fontURL = fontFile.toURI().toURL();
             } catch (MalformedURLException e) {
-                // Should never happen
-                log.debug("Malformed Url: " + e.getMessage());
-                return null;
+                LogUtil.handleException(log, e, strict);
             }
             if (fontFile != null) {
                 FontInfoFinder finder = new FontInfoFinder();
                 finder.setEventListener(listener);
-                EmbedFontInfo[] infos = finder.find(fontUrl, fontResolver, fontCache);
+                EmbedFontInfo[] infos = finder.find(fontURL, fontResolver, fontCache);
                 return infos[0]; //When subFont is set, only one font is returned
             } else {
                 return null;
             }
         }
 
-        List/*<FontTriplet>*/ tripletList = new java.util.ArrayList/*<FontTriplet>*/();
+        List<FontTriplet> tripletList = new java.util.ArrayList<FontTriplet>();
         for (int j = 0; j < tripletCfg.length; j++) {
             FontTriplet fontTriplet = getFontTriplet(tripletCfg[j]);
             tripletList.add(fontTriplet);
@@ -269,7 +267,7 @@ public class FontInfoConfigurator {
             log.debug("Adding font " + (embedFile != null ? embedFile + ", " : "")
                     + "metric file " + embedFontInfo.getMetricsFile());
             for (int j = 0; j < tripletList.size(); ++j) {
-                FontTriplet triplet = (FontTriplet) tripletList.get(j);
+                FontTriplet triplet = tripletList.get(j);
                 log.debug("  Font triplet "
                         + triplet.getName() + ", "
                         + triplet.getStyle() + ", "

Added: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontDirFinder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontDirFinder.java?rev=1039502&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontDirFinder.java (added)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontDirFinder.java Fri Nov 26 18:37:40 2010
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.fonts.autodetect;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Implementers provide find method for searching native operating system
+ * for available fonts.
+ */
+public interface FontDirFinder {
+
+    /**
+     * Finds a list of font files.
+     *
+     * @return list of font files.
+     * @throws IOException
+     *             In case of an I/O problem
+     */
+    List<File> find() throws IOException;
+
+}

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontDirFinder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontDirFinder.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontFileFinder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontFileFinder.java?rev=1039502&r1=1039501&r2=1039502&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontFileFinder.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontFileFinder.java Fri Nov 26 18:37:40 2010
@@ -22,8 +22,8 @@ package org.apache.fop.fonts.autodetect;
 import java.io.File;
 import java.io.IOException;
 import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.commons.io.DirectoryWalker;
@@ -91,6 +91,7 @@ public class FontFileFinder extends Dire
      * @return whether directory should be handled
      * {@inheritDoc}
      */
+    @Override
     protected boolean handleDirectory(File directory, int depth, Collection results) {
         return true;
     }
@@ -101,6 +102,7 @@ public class FontFileFinder extends Dire
      * @param results collection
      * {@inheritDoc}
      */
+    @Override
     protected void handleFile(File file, int depth, Collection results) {
         try {
             // Looks Strange, but is actually recommended over just .URL()
@@ -116,6 +118,7 @@ public class FontFileFinder extends Dire
      * @param results the collection of results objects
      * {@inheritDoc}
      */
+    @Override
     protected void handleDirectoryEnd(File directory, int depth, Collection results) {
         if (log.isDebugEnabled()) {
             log.debug(directory + ": found " + results.size() + " font"
@@ -130,8 +133,8 @@ public class FontFileFinder extends Dire
      * @throws IOException io exception
      * {@inheritDoc}
      */
-    public List/*<URL>*/ find() throws IOException {
-        final FontFinder fontDirFinder;
+    public List<URL> find() throws IOException {
+        final FontDirFinder fontDirFinder;
         final String osName = System.getProperty("os.name");
         if (osName.startsWith("Windows")) {
             fontDirFinder = new WindowsFontDirFinder();
@@ -142,10 +145,9 @@ public class FontFileFinder extends Dire
                 fontDirFinder = new UnixFontDirFinder();
             }
         }
-        List/*<URL>*/ fontDirs = fontDirFinder.find();
-        List/*<URL>*/ results = new java.util.ArrayList/*<URL>*/();
-        for (Iterator iter = fontDirs.iterator(); iter.hasNext();) {
-            final File dir = (File)iter.next();
+        List<File> fontDirs = fontDirFinder.find();
+        List<URL> results = new java.util.ArrayList<URL>();
+        for (File dir : fontDirs) {
             super.walk(dir, results);
         }
         return results;
@@ -158,8 +160,8 @@ public class FontFileFinder extends Dire
      * @return list of font files
      * @throws IOException thrown if an I/O exception of some sort has occurred
      */
-    public List find(String dir) throws IOException {
-        List results = new java.util.ArrayList();
+    public List<URL> find(String dir) throws IOException {
+        List<URL> results = new java.util.ArrayList<URL>();
         super.walk(new File(dir), results);
         return results;
     }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontFinder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontFinder.java?rev=1039502&r1=1039501&r2=1039502&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontFinder.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontFinder.java Fri Nov 26 18:37:40 2010
@@ -20,6 +20,7 @@
 package org.apache.fop.fonts.autodetect;
 
 import java.io.IOException;
+import java.net.URL;
 import java.util.List;
 
 /**
@@ -31,12 +32,10 @@ public interface FontFinder {
     /**
      * Finds a list of font files.
      *
-     * @return list of font files. List&lt;URL&gt; in the case of the
-     *         FontFinder, and List&lt;File&gt; in the case of the
-     *         FonrDirFinders.
+     * @return list of font files.
      * @throws IOException
      *             In case of an I/O problem
      */
-    List find() throws IOException;
+    List<URL> find() throws IOException;
 
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java?rev=1039502&r1=1039501&r2=1039502&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java Fri Nov 26 18:37:40 2010
@@ -22,7 +22,6 @@ package org.apache.fop.fonts.autodetect;
 import java.io.InputStream;
 import java.net.URL;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 import java.util.regex.Pattern;
@@ -30,7 +29,6 @@ import java.util.regex.Pattern;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
 import org.apache.fop.fonts.CustomFont;
 import org.apache.fop.fonts.EmbedFontInfo;
 import org.apache.fop.fonts.EncodingMode;
@@ -52,7 +50,7 @@ import org.apache.fop.fonts.truetype.TTF
 public class FontInfoFinder {
 
     /** logging instance */
-    private Log log = LogFactory.getLog(FontInfoFinder.class);
+    private final Log log = LogFactory.getLog(FontInfoFinder.class);
 
     private FontEventListener eventListener;
 
@@ -72,7 +70,7 @@ public class FontInfoFinder {
      * @param customFont CustomFont
      * @param triplets Collection that will take the generated triplets
      */
-    private void generateTripletsFromFont(CustomFont customFont, Collection triplets) {
+    private void generateTripletsFromFont(CustomFont customFont, Collection<FontTriplet> triplets) {
         if (log.isTraceEnabled()) {
             log.trace("Font: " + customFont.getFullName()
                     + ", family: " + customFont.getFamilyNames()
@@ -99,10 +97,9 @@ public class FontInfoFinder {
         if (!fullName.equals(strippedName)) {
             triplets.add(new FontTriplet(strippedName, Font.STYLE_NORMAL, Font.WEIGHT_NORMAL));
         }
-        Set familyNames = customFont.getFamilyNames();
-        Iterator iter = familyNames.iterator();
-        while (iter.hasNext()) {
-            String familyName = stripQuotes((String)iter.next());
+        Set<String> familyNames = customFont.getFamilyNames();
+        for (String familyName : familyNames) {
+            familyName = stripQuotes(familyName);
             if (!fullName.equals(familyName)) {
                 /* Heuristic:
                  *   The more similar the family name to the full font name,
@@ -135,17 +132,17 @@ public class FontInfoFinder {
 
     /**
      * Attempts to determine FontInfo from a given custom font
-     * @param fontUrl the font URL
+     * @param fontURL the font URL
      * @param customFont the custom font
      * @param fontCache font cache (may be null)
      * @return FontInfo from the given custom font
      */
     private EmbedFontInfo getFontInfoFromCustomFont(
-            URL fontUrl, CustomFont customFont, FontCache fontCache) {
-        List fontTripletList = new java.util.ArrayList();
+            URL fontURL, CustomFont customFont, FontCache fontCache) {
+        List<FontTriplet> fontTripletList = new java.util.ArrayList<FontTriplet>();
         generateTripletsFromFont(customFont, fontTripletList);
         String embedUrl;
-        embedUrl = fontUrl.toExternalForm();
+        embedUrl = fontURL.toExternalForm();
         String subFontName = null;
         if (customFont instanceof MultiByteFont) {
             subFontName = ((MultiByteFont)customFont).getTTCName();
@@ -162,29 +159,29 @@ public class FontInfoFinder {
     /**
      * Attempts to determine EmbedFontInfo from a given font file.
      *
-     * @param fontUrl font URL. Assumed to be local.
+     * @param fontURL font URL. Assumed to be local.
      * @param resolver font resolver used to resolve font
      * @param fontCache font cache (may be null)
      * @return an array of newly created embed font info. Generally, this array
      *         will have only one entry, unless the fontUrl is a TrueType Collection
      */
-    public EmbedFontInfo[] find(URL fontUrl, FontResolver resolver, FontCache fontCache) {
-        String embedUrl = null;
-        embedUrl = fontUrl.toExternalForm();
+    public EmbedFontInfo[] find(URL fontURL, FontResolver resolver, FontCache fontCache) {
+        String embedURL = null;
+        embedURL = fontURL.toExternalForm();
 
         long fileLastModified = -1;
         if (fontCache != null) {
-            fileLastModified = FontCache.getLastModified(fontUrl);
+            fileLastModified = FontCache.getLastModified(fontURL);
             // firstly try and fetch it from cache before loading/parsing the font file
-            if (fontCache.containsFont(embedUrl)) {
-                EmbedFontInfo[] fontInfos = fontCache.getFontInfos(embedUrl, fileLastModified);
+            if (fontCache.containsFont(embedURL)) {
+                EmbedFontInfo[] fontInfos = fontCache.getFontInfos(embedURL, fileLastModified);
                 if (fontInfos != null) {
                     return fontInfos;
                 }
             // is this a previously failed parsed font?
-            } else if (fontCache.isFailedFont(embedUrl, fileLastModified)) {
+            } else if (fontCache.isFailedFont(embedURL, fileLastModified)) {
                 if (log.isDebugEnabled()) {
-                    log.debug("Skipping font file that failed to load previously: " + embedUrl);
+                    log.debug("Skipping font file that failed to load previously: " + embedURL);
                 }
                 return null;
             }
@@ -193,77 +190,72 @@ public class FontInfoFinder {
 
         // try to determine triplet information from font file
         CustomFont customFont = null;
-        if (fontUrl.toExternalForm().endsWith(".ttc")) {
+        if (fontURL.toExternalForm().endsWith(".ttc")) {
             // Get a list of the TTC Font names
-            List ttcNames = null; //List<String>
-            String fontFileURI = fontUrl.toExternalForm().trim();
+            List<String> ttcNames = null;
+            String fontFileURL = fontURL.toExternalForm().trim();
             InputStream in = null;
             try {
-                in = FontLoader.openFontUri(resolver, fontFileURI);
+                in = FontLoader.openFontUri(resolver, fontFileURL);
                 TTFFile ttf = new TTFFile();
                 FontFileReader reader = new FontFileReader(in);
                 ttcNames = ttf.getTTCnames(reader);
             } catch (Exception e) {
                 if (this.eventListener != null) {
-                    this.eventListener.fontLoadingErrorAtAutoDetection(this, fontFileURI, e);
+                    this.eventListener.fontLoadingErrorAtAutoDetection(this, fontFileURL, e);
                 }
                 return null;
             } finally {
                 IOUtils.closeQuietly(in);
             }
 
-            List/*<EmbedFontInfo>*/ embedFontInfoList
-                = new java.util.ArrayList/*<EmbedFontInfo>*/();
+            List<EmbedFontInfo> embedFontInfoList = new java.util.ArrayList<EmbedFontInfo>();
 
             // For each font name ...
-            //for (String fontName : ttcNames) {
-            Iterator ttcNamesIterator = ttcNames.iterator();
-            while (ttcNamesIterator.hasNext()) {
-                String fontName = (String)ttcNamesIterator.next();
-
+            for (String fontName : ttcNames) {
                 if (log.isDebugEnabled()) {
                     log.debug("Loading " + fontName);
                 }
                 try {
                     TTFFontLoader ttfLoader = new TTFFontLoader(
-                            fontFileURI, fontName, true, EncodingMode.AUTO, true, resolver);
+                            fontFileURL, fontName, true, EncodingMode.AUTO, true, resolver);
                     customFont = ttfLoader.getFont();
                     if (this.eventListener != null) {
                         customFont.setEventListener(this.eventListener);
                     }
                 } catch (Exception e) {
                     if (fontCache != null) {
-                        fontCache.registerFailedFont(embedUrl, fileLastModified);
+                        fontCache.registerFailedFont(embedURL, fileLastModified);
                     }
                     if (this.eventListener != null) {
-                        this.eventListener.fontLoadingErrorAtAutoDetection(this, embedUrl, e);
+                        this.eventListener.fontLoadingErrorAtAutoDetection(this, embedURL, e);
                     }
                     continue;
                 }
-                EmbedFontInfo fi = getFontInfoFromCustomFont(fontUrl, customFont, fontCache);
+                EmbedFontInfo fi = getFontInfoFromCustomFont(fontURL, customFont, fontCache);
                 if (fi != null) {
                     embedFontInfoList.add(fi);
                 }
             }
-            return (EmbedFontInfo[])embedFontInfoList.toArray(
+            return embedFontInfoList.toArray(
                     new EmbedFontInfo[embedFontInfoList.size()]);
         } else {
             // The normal case
             try {
-                customFont = FontLoader.loadFont(fontUrl, null, true, EncodingMode.AUTO, resolver);
+                customFont = FontLoader.loadFont(fontURL, null, true, EncodingMode.AUTO, resolver);
                 if (this.eventListener != null) {
                     customFont.setEventListener(this.eventListener);
                 }
             } catch (Exception e) {
                 if (fontCache != null) {
-                    fontCache.registerFailedFont(embedUrl, fileLastModified);
+                    fontCache.registerFailedFont(embedURL, fileLastModified);
                 }
                 if (this.eventListener != null) {
-                    this.eventListener.fontLoadingErrorAtAutoDetection(this, embedUrl, e);
+                    this.eventListener.fontLoadingErrorAtAutoDetection(this, embedURL, e);
                 }
                 return null;
             }
-            EmbedFontInfo fi = getFontInfoFromCustomFont(fontUrl, customFont, fontCache);
+            EmbedFontInfo fi = getFontInfoFromCustomFont(fontURL, customFont, fontCache);
             if (fi != null) {
                 return new EmbedFontInfo[] {fi};
             } else {

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/NativeFontDirFinder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/NativeFontDirFinder.java?rev=1039502&r1=1039501&r2=1039502&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/NativeFontDirFinder.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/NativeFontDirFinder.java Fri Nov 26 18:37:40 2010
@@ -25,15 +25,15 @@ import java.util.List;
 /**
  * Native font finder base class
  */
-public abstract class NativeFontDirFinder implements FontFinder {
+public abstract class NativeFontDirFinder implements FontDirFinder {
 
     /**
      * Generic method used by Mac and Unix font finders.
      * @return list of natively existing font directories
      * {@inheritDoc}
      */
-    public List find() {
-        List fontDirList = new java.util.ArrayList();
+    public List<File> find() {
+        List<File> fontDirList = new java.util.ArrayList<File>();
         String[] searchableDirectories = getSearchableDirectories();
         if (searchableDirectories != null) {
             for (int i = 0; i < searchableDirectories.length; i++) {

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/WindowsFontDirFinder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/WindowsFontDirFinder.java?rev=1039502&r1=1039501&r2=1039502&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/WindowsFontDirFinder.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/WindowsFontDirFinder.java Fri Nov 26 18:37:40 2010
@@ -28,7 +28,7 @@ import java.util.List;
 /**
  * FontFinder for native Windows platforms
  */
-public class WindowsFontDirFinder implements FontFinder {
+public class WindowsFontDirFinder implements FontDirFinder {
 
     /**
      * Attempts to read windir environment variable on windows
@@ -51,8 +51,8 @@ public class WindowsFontDirFinder implem
      * {@inheritDoc}
      * @return a list of detected font files
      */
-    public List find() {
-        List fontDirList = new java.util.ArrayList();
+    public List<File> find() {
+        List<File> fontDirList = new java.util.ArrayList<File>();
         String windir = null;
         try {
             windir = System.getProperty("env.windir");

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/truetype/TTFFile.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/truetype/TTFFile.java?rev=1039502&r1=1039501&r2=1039502&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/truetype/TTFFile.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/truetype/TTFFile.java Fri Nov 26 18:37:40 2010
@@ -1568,8 +1568,8 @@ public class TTFFile {
      * @return True if not collection or font name present, false otherwise
      * @throws IOException In case of an I/O problem
      */
-    public final List getTTCnames(FontFileReader in) throws IOException {
-        List fontNames = new java.util.ArrayList();
+    public final List<String> getTTCnames(FontFileReader in) throws IOException {
+        List<String> fontNames = new java.util.ArrayList<String>();
 
         String tag = in.readTTFString(4);
 



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org