changeset 12665:1f5c744d3d57

8170950: Text is displayed in bold when fonts are installed into symlinked folder Reviewed-by: prr, serb
author dbatrak
date Fri, 17 Feb 2017 17:29:44 +0300
parents fd839d3eb879
children cec5310dcc2b
files src/share/classes/sun/font/FontFamily.java
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/font/FontFamily.java	Fri Feb 17 15:14:31 2017 +0300
+++ b/src/share/classes/sun/font/FontFamily.java	Fri Feb 17 17:29:44 2017 +0300
@@ -27,6 +27,7 @@
 
 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;
@@ -132,6 +133,16 @@
 
         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);
     }