Skip to content

Commit

Permalink
8276179: PrismFontFile.isInstalledFont is dead code and should be rem…
Browse files Browse the repository at this point in the history
…oved

Reviewed-by: prr, kcr
  • Loading branch information
FlorianKirmaier authored and kevinrushforth committed Nov 2, 2021
1 parent 6c88106 commit cde72c8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

1 comment on commit cde72c8

@openjdk-notifier
Copy link

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.