Skip to content
Permalink
Browse files
8276179: PrismFontFile.isInstalledFont is dead code and should be rem…
…oved

Reviewed-by: prr, kcr
  • Loading branch information
FlorianKirmaier authored and kevinrushforth committed Nov 2, 2021
1 parent 6c88106 commit cde72c8e2988f267230625d976fff85576858766
@@ -727,31 +727,6 @@ public synchronized FontResource getFontResource(String name, String file,
return null;
}

boolean isInstalledFont(String fileName) {
// avoid loading the full windows map. Ignore drive letter
// as its common to install on D: too in multi-boot.
String fileKey;
if (isWindows) {
if (fileName.toLowerCase().contains("\\windows\\fonts")) {
return true;
}
File f = new File(fileName);
fileKey = f.getName();
} else {
if (isMacOSX && fileName.toLowerCase().contains("/library/fonts")) {
// Most fonts are installed in either /System/Library/Fonts/
// or /Library/Fonts/
return true;
}
File f = new File(fileName);
// fileToFontMap key is the full path on non-windows
fileKey = f.getPath();
}

getFullNameToFileMap();
return fileToFontMap.get(fileKey.toLowerCase()) != null;
}

/* To be called only by methods that already inited the maps
*/
synchronized private FontResource
@@ -42,8 +42,6 @@

public abstract class PrismFontFile implements FontResource, FontConstants {

private int fontInstallationType = -1; // unknown, 0=embedded, 1=system

// TrueType fonts can have multiple names, most notably split up by
// platform and locale. Whilst fonts that have different names for
// different platforms are arguable buggy, those with localised names
@@ -156,13 +154,6 @@ public int getDefaultAAMode() {
return AA_GREYSCALE;
}

public boolean isInstalledFont() {
if (fontInstallationType == -1) {
PrismFontFactory factory = PrismFontFactory.getFontFactory();
fontInstallationType = factory.isInstalledFont(filename) ? 1 : 0;
}
return fontInstallationType > 0;
}


/* A TTC file resource is shared, so reference count and delete

1 comment on commit cde72c8

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on cde72c8 Nov 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.