< prev index next >

src/java.desktop/share/classes/sun/awt/FontConfiguration.java

Print this page

        

*** 365,374 **** --- 365,395 ---- in.read(bb); int i = 0, j = 0; while (i < len) { table_stringTable[i++] = (char)(bb[j++] << 8 | (bb[j++] & 0xff)); } + if (System.getProperty("os.name").contains("AIX")) { + // Fix broken fontconfig.bfc on AIX + // Encoding name "ucs2.cjk_*" needs to handle as "ucs2.cjk *" + HashMap<String, Short> fixComponentFontNameID = new HashMap<String, Short>(); + for (short ii = 0; ii < table_componentFontNameIDs.length; ii++) { + String fontName = getString(table_componentFontNameIDs[ii]); + if (fontName.indexOf("-ucs2.cjk ") > -1) { + fixComponentFontNameID.put(fontName, ii); + } + } + for (short ii = 0; ii < table_componentFontNameIDs.length; ii++) { + String fontName = getString(table_componentFontNameIDs[ii]); + if (fontName.indexOf("-ucs2.cjk_") > -1) { + fontName = fontName.replace('_', ' '); + if (fixComponentFontNameID.containsKey(fontName)) { + short jj = fixComponentFontNameID.get(fontName); + table_filenames[ii] = table_filenames[jj]; + } + } + } + } if (verbose) { dump(); } }
*** 2118,2128 **** --- 2139,2160 ---- if (key.startsWith("filename.")) { //the only special case is "MingLiu_HKSCS" which has "_" in its //facename, we don't want to replace the "_" with " " key = key.substring(9); if (!"MingLiU_HKSCS".equals(key)) { + String[] parts = key.split("-"); + if (parts.length == 15) { + // Underscore->Space conversion only applies + // against FOUNDRY(1), FAMILY_NAME(2), WEIGHT_NAME(3) + // SLANT(4), SETWIDTH_NAME(5), ADD_STYLE_NAME(6) on XLFD + for (int i = 1; i < 7; i++) { + parts[i] = parts[i].replace('_', ' '); + } + key = String.join("-", parts); + } else { key = key.replace('_', ' '); + } } Short faceID = getID(componentFontNameIDs, key); Short fileID = getID(fontfileNameIDs, value); //System.out.println("faceID=" + faceID + "/" + key + " -> " // + "fileID=" + fileID + "/" + value);
< prev index next >