< prev index next >

src/java.desktop/share/classes/sun/font/FontFamily.java

Print this page

        

@@ -25,10 +25,11 @@
 
 package sun.font;
 
 import java.io.File;
 import java.awt.Font;
+import java.io.IOException;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.Locale;
 

@@ -130,10 +131,20 @@
         }
         File existDir = (new File(existingFont.platName)).getParentFile();
 
         FileFont newFont = (FileFont)font;
         File newDir = (new File(newFont.platName)).getParentFile();
+        if (existDir != null) {
+            try {
+                existDir = existDir.getCanonicalFile();
+            } catch (IOException ignored) {}
+        }
+        if (newDir != null) {
+            try {
+                newDir = newDir.getCanonicalFile();
+            } catch (IOException ignored) {}
+        }
         return java.util.Objects.equals(newDir, existDir);
     }
 
     /*
      * We want a family to be of the same width and prefer medium/normal width.
< prev index next >