< prev index next >
src/java.desktop/unix/classes/sun/awt/X11FontManager.java
Print this page
rev 60064 : 8248802: Add log helper methods to FontUtilities.java
*** 222,240 ****
if (fontID != null) {
fileName = fontNameMap.get(fontID);
if (fontPath == null &&
(fileName == null || !fileName.startsWith("/"))) {
if (FontUtilities.debugFonts()) {
! FontUtilities.getLogger()
! .warning("** Registering all font paths because " +
"can't find file for " + platName);
}
fontPath = getPlatformFontPath(noType1Font);
registerFontDirs(fontPath);
if (FontUtilities.debugFonts()) {
! FontUtilities.getLogger()
! .warning("** Finished registering all font paths");
}
fileName = fontNameMap.get(fontID);
}
if (fileName == null && !isHeadless()) {
/* Query X11 directly to see if this font is available
--- 222,238 ----
if (fontID != null) {
fileName = fontNameMap.get(fontID);
if (fontPath == null &&
(fileName == null || !fileName.startsWith("/"))) {
if (FontUtilities.debugFonts()) {
! FontUtilities.logWarning("** Registering all font paths because " +
"can't find file for " + platName);
}
fontPath = getPlatformFontPath(noType1Font);
registerFontDirs(fontPath);
if (FontUtilities.debugFonts()) {
! FontUtilities.logWarning("** Finished registering all font paths");
}
fileName = fontNameMap.get(fontID);
}
if (fileName == null && !isHeadless()) {
/* Query X11 directly to see if this font is available
*** 287,297 ****
* Arial.ttf -monotype-arial-regular-r-normal--0-0-0-0-p-0-iso8859-1
* Arial-Bold.ttf -monotype-arial-bold-r-normal--0-0-0-0-p-0-iso8859-1
* ...
*/
if (FontUtilities.debugFonts()) {
! FontUtilities.getLogger().info("ParseFontDir " + path);
}
File fontsDotDir = new File(path + File.separator + "fonts.dir");
FileReader fr = null;
try {
if (fontsDotDir.canRead()) {
--- 285,295 ----
* Arial.ttf -monotype-arial-regular-r-normal--0-0-0-0-p-0-iso8859-1
* Arial-Bold.ttf -monotype-arial-bold-r-normal--0-0-0-0-p-0-iso8859-1
* ...
*/
if (FontUtilities.debugFonts()) {
! FontUtilities.logInfo("ParseFontDir " + path);
}
File fontsDotDir = new File(path + File.separator + "fonts.dir");
FileReader fr = null;
try {
if (fontsDotDir.canRead()) {
*** 366,379 ****
String fontPart = st.sval.substring(breakPos+1);
String fontID = specificFontIDForName(fontPart);
String sVal = fontNameMap.get(fontID);
if (FontUtilities.debugFonts()) {
! PlatformLogger logger = FontUtilities.getLogger();
! logger.info("file=" + fileName +
" xlfd=" + fontPart);
! logger.info("fontID=" + fontID +
" sVal=" + sVal);
}
String fullPath = null;
try {
File file = new File(path,fileName);
--- 364,376 ----
String fontPart = st.sval.substring(breakPos+1);
String fontID = specificFontIDForName(fontPart);
String sVal = fontNameMap.get(fontID);
if (FontUtilities.debugFonts()) {
! FontUtilities.logInfo("file=" + fileName +
" xlfd=" + fontPart);
! FontUtilities.logInfo("fontID=" + fontID +
" sVal=" + sVal);
}
String fullPath = null;
try {
File file = new File(path,fileName);
*** 392,410 ****
} catch (IOException e) {
fullPath = path + File.separator + fileName;
}
Vector<String> xVal = xlfdMap.get(fullPath);
if (FontUtilities.debugFonts()) {
! FontUtilities.getLogger()
! .info("fullPath=" + fullPath +
" xVal=" + xVal);
}
if ((xVal == null || !xVal.contains(fontPart)) &&
(sVal == null) || !sVal.startsWith("/")) {
if (FontUtilities.debugFonts()) {
! FontUtilities.getLogger()
! .info("Map fontID:"+fontID +
"to file:" + fullPath);
}
fontNameMap.put(fontID, fullPath);
if (xVal == null) {
xVal = new Vector<>();
--- 389,405 ----
} catch (IOException e) {
fullPath = path + File.separator + fileName;
}
Vector<String> xVal = xlfdMap.get(fullPath);
if (FontUtilities.debugFonts()) {
! FontUtilities.logInfo("fullPath=" + fullPath +
" xVal=" + xVal);
}
if ((xVal == null || !xVal.contains(fontPart)) &&
(sVal == null) || !sVal.startsWith("/")) {
if (FontUtilities.debugFonts()) {
! FontUtilities.logInfo("Map fontID:"+fontID +
"to file:" + fullPath);
}
fontNameMap.put(fontID, fullPath);
if (xVal == null) {
xVal = new Vector<>();
*** 479,490 ****
}
}
if (hyphenCnt != 14) {
if (FontUtilities.debugFonts()) {
! FontUtilities.getLogger()
! .severe("Font Configuration Font ID is malformed:" + name);
}
return name; // what else can we do?
}
StringBuffer sb =
--- 474,484 ----
}
}
if (hyphenCnt != 14) {
if (FontUtilities.debugFonts()) {
! FontUtilities.logSevere("Font Configuration Font ID is malformed:" + name);
}
return name; // what else can we do?
}
StringBuffer sb =
*** 509,520 ****
}
}
if (hyphenCnt != 14) {
if (FontUtilities.debugFonts()) {
! FontUtilities.getLogger()
! .severe("Font Configuration Font ID is malformed:" + name);
}
return name; // what else can we do?
}
String slant = name.substring(hPos[SLANT_FIELD-1]+1,
--- 503,513 ----
}
}
if (hyphenCnt != 14) {
if (FontUtilities.debugFonts()) {
! FontUtilities.logSevere("Font Configuration Font ID is malformed:" + name);
}
return name; // what else can we do?
}
String slant = name.substring(hPos[SLANT_FIELD-1]+1,
*** 673,683 ****
if (fontConfigDirs == null) {
fontConfigDirs = getFontConfiguration().getAWTFontPathSet();
if (FontUtilities.debugFonts() && fontConfigDirs != null) {
String[] names = fontConfigDirs.toArray(new String[0]);
for (int i=0;i<names.length;i++) {
! FontUtilities.getLogger().info("awtfontpath : " + names[i]);
}
}
}
}
--- 666,676 ----
if (fontConfigDirs == null) {
fontConfigDirs = getFontConfiguration().getAWTFontPathSet();
if (FontUtilities.debugFonts() && fontConfigDirs != null) {
String[] names = fontConfigDirs.toArray(new String[0]);
for (int i=0;i<names.length;i++) {
! FontUtilities.logInfo("awtfontpath : " + names[i]);
}
}
}
}
< prev index next >