Bug 53143 - fonts loaded twice (redundantly)
fonts loaded twice (redundantly)
Product: Fop - Now in Jira
Classification: Unclassified
Component: fonts
All All
: P2 normal
: ---
Assigned To: fop-dev
Depends on:
  Show dependency tree
Reported: 2012-04-24 22:14 UTC by Glenn Adams
Modified: 2012-04-24 22:42 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Glenn Adams 2012-04-24 22:14:20 UTC
due to a coding error introduced in revision 1198853 [1], fonts are redundantly loaded twice

[1] http://svn.apache.org/viewvc?view=revision&revision=1198853

more specifically, the code change at [2]

[2] http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/autodetect/FontFileFinder.java?r1=1198853&r2=1198852&pathrev=1198853


     public List<URL> find(String dir) throws IOException {
         List<URL> results = new java.util.ArrayList<URL>();
         super.walk(new File(dir), results);
+        File directory = new File(dir);
+        if (!directory.isDirectory()) {
+            eventListener.fontDirectoryNotFound(this, dir);
+        } else {
+            super.walk(directory, results);
+        }
         return results;

results in calling super.walk(...) twice which has the effect of adding each font twice to the returned List<URL>, which in turn results in each font being loaded twice in FontInfoConfigurator.addDirectories():

     fontURLList = fontFileFinder.find(directory);
     fontAdder.add(fontURLList, fontInfoList);
Comment 1 Glenn Adams 2012-04-24 22:42:50 UTC