8162432: Clean up references in font code to old Solaris releases.
Reviewed-by: bpb
--- a/jdk/src/java.desktop/share/classes/sun/font/FontUtilities.java Fri Jul 22 15:57:57 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/sun/font/FontUtilities.java Fri Jul 22 16:07:45 2016 -0700
@@ -50,12 +50,6 @@
public static boolean isMacOSX;
- public static boolean isSolaris8;
-
- public static boolean isSolaris9;
-
- public static boolean isOpenSolaris;
-
public static boolean useT2K;
public static boolean isWindows;
@@ -88,37 +82,6 @@
} else {
useT2K = false;
}
- if (isSolaris) {
- String version = System.getProperty("os.version", "0.0");
- isSolaris8 = version.startsWith("5.8");
- isSolaris9 = version.startsWith("5.9");
- float ver = Float.parseFloat(version);
- if (ver > 5.10f) {
- File f = new File("/etc/release");
- String line = null;
- try {
- FileInputStream fis = new FileInputStream(f);
- InputStreamReader isr = new InputStreamReader(
- fis, "ISO-8859-1");
- BufferedReader br = new BufferedReader(isr);
- line = br.readLine();
- fis.close();
- } catch (Exception ex) {
- // Nothing to do here.
- }
- if (line != null && line.indexOf("OpenSolaris") >= 0) {
- isOpenSolaris = true;
- } else {
- isOpenSolaris = false;
- }
- } else {
- isOpenSolaris = false;
- }
- } else {
- isSolaris8 = false;
- isSolaris9 = false;
- isOpenSolaris = false;
- }
isWindows = osName.startsWith("Windows");
String jreLibDirName = System.getProperty("java.home", "")
+ File.separator + "lib";
--- a/jdk/src/java.desktop/share/classes/sun/font/TrueTypeGlyphMapper.java Fri Jul 22 15:57:57 2016 -0700
+++ b/jdk/src/java.desktop/share/classes/sun/font/TrueTypeGlyphMapper.java Fri Jul 22 16:07:45 2016 -0700
@@ -32,8 +32,6 @@
static final char REVERSE_SOLIDUS = 0x005c; // the backslash char.
static final char JA_YEN = 0x00a5;
- static final char JA_FULLWIDTH_TILDE_CHAR = 0xff5e;
- static final char JA_WAVE_DASH_CHAR = 0x301c;
/* if running on Solaris and default Locale is ja_JP then
* we map need to remap reverse solidus (backslash) to Yen as
@@ -41,7 +39,6 @@
*/
static final boolean isJAlocale = Locale.JAPAN.equals(Locale.getDefault());
private final boolean needsJAremapping;
- private boolean remapJAWaveDash;
TrueTypeFont font;
CMap cmap;
@@ -66,10 +63,6 @@
}
if (FontUtilities.isSolaris && isJAlocale && font.supportsJA()) {
needsJAremapping = true;
- if (FontUtilities.isSolaris8 &&
- getGlyphFromCMAP(JA_WAVE_DASH_CHAR) == missingGlyph) {
- remapJAWaveDash = true;
- }
} else {
needsJAremapping = false;
}
@@ -113,35 +106,12 @@
cmap = CMap.theNullCmap;
}
- @SuppressWarnings("fallthrough")
private final char remapJAChar(char unicode) {
- switch (unicode) {
- case REVERSE_SOLIDUS:
- return JA_YEN;
- /* This is a workaround for bug 4533422.
- * Japanese wave dash missing from Solaris JA TrueType fonts.
- */
- case JA_WAVE_DASH_CHAR:
- if (remapJAWaveDash) {
- return JA_FULLWIDTH_TILDE_CHAR;
- }
- default: return unicode;
- }
+ return (unicode == REVERSE_SOLIDUS) ? JA_YEN : unicode;
}
- @SuppressWarnings("fallthrough")
+
private final int remapJAIntChar(int unicode) {
- switch (unicode) {
- case REVERSE_SOLIDUS:
- return JA_YEN;
- /* This is a workaround for bug 4533422.
- * Japanese wave dash missing from Solaris JA TrueType fonts.
- */
- case JA_WAVE_DASH_CHAR:
- if (remapJAWaveDash) {
- return JA_FULLWIDTH_TILDE_CHAR;
- }
- default: return unicode;
- }
+ return (unicode == REVERSE_SOLIDUS) ? JA_YEN : unicode;
}
public int charToGlyph(char unicode) {
--- a/jdk/src/java.desktop/unix/classes/sun/font/MFontConfiguration.java Fri Jul 22 15:57:57 2016 -0700
+++ b/jdk/src/java.desktop/unix/classes/sun/font/MFontConfiguration.java Fri Jul 22 16:07:45 2016 -0700
@@ -88,21 +88,13 @@
reorderMap.put("UTF-8.th", "thai");
reorderMap.put("UTF-8.zh.TW", "chinese-big5");
reorderMap.put("UTF-8.zh.HK", split("chinese-big5,chinese-hkscs"));
- if (FontUtilities.isSolaris8) {
- reorderMap.put("UTF-8.zh.CN", split("chinese-gb2312,chinese-big5"));
- } else {
- reorderMap.put("UTF-8.zh.CN",
- split("chinese-gb18030-0,chinese-gb18030-1"));
- }
+ reorderMap.put("UTF-8.zh.CN",
+ split("chinese-gb18030-0,chinese-gb18030-1"));
reorderMap.put("UTF-8.zh",
split("chinese-big5,chinese-hkscs,chinese-gb18030-0,chinese-gb18030-1"));
reorderMap.put("Big5", "chinese-big5");
reorderMap.put("Big5-HKSCS", split("chinese-big5,chinese-hkscs"));
- if (! FontUtilities.isSolaris8 && ! FontUtilities.isSolaris9) {
- reorderMap.put("GB2312", split("chinese-gbk,chinese-gb2312"));
- } else {
- reorderMap.put("GB2312","chinese-gb2312");
- }
+ reorderMap.put("GB2312", split("chinese-gbk,chinese-gb2312"));
reorderMap.put("x-EUC-TW",
split("chinese-cns11643-1,chinese-cns11643-2,chinese-cns11643-3"));
reorderMap.put("GBK", "chinese-gbk");