< prev index next >
src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java
Print this page
rev 55624 : 8227441: Enhance logging when reading the fontconfig info file
*** 427,436 ****
--- 427,439 ----
* the system cache.
*/
private void readFcInfo() {
File fcFile = getFcInfoFile();
if (!fcFile.exists()) {
+ if (FontUtilities.debugFonts()) {
+ warning("fontconfig info file " + fcFile.toString() + " does not exist");
+ }
return;
}
Properties props = new Properties();
FcFontManager fm = (FcFontManager) fontManager;
FontConfigManager fcm = fm.getFontConfigManager();
*** 444,453 ****
--- 447,459 ----
}
return;
}
String version = (String)props.get("version");
if (version == null || !version.equals(fileVersion)) {
+ if (FontUtilities.debugFonts()) {
+ warning("fontconfig info file caused a version mismatch");
+ }
return;
}
// If there's a new, different fontconfig installed on the
// system, we invalidate our fontconfig file.
*** 456,465 ****
--- 462,474 ----
int fcVersion;
try {
fcVersion = Integer.parseInt(fcVersionStr);
if (fcVersion != 0 &&
fcVersion != FontConfigManager.getFontConfigVersion()) {
+ if (FontUtilities.debugFonts()) {
+ warning("new, different fontconfig detected");
+ }
return;
}
} catch (Exception e) {
if (FontUtilities.debugFonts()) {
warning("Exception parsing version " + fcVersionStr);
*** 478,487 ****
--- 487,499 ----
if (dir == null) {
break;
}
File dirFile = new File(dir);
if (dirFile.exists() && dirFile.lastModified() > lastModified) {
+ if (FontUtilities.debugFonts()) {
+ warning("Out of date cache directories detected");
+ }
return;
}
cacheDirIndex++;
}
*** 501,510 ****
--- 513,525 ----
fci[index].fcFamily = fcnames[i];
fci[index].style = s;
String lenStr = (String)props.get(key+".length");
int nfonts = Integer.parseInt(lenStr);
if (nfonts <= 0) {
+ if (FontUtilities.debugFonts()) {
+ warning("Bad non-positive .length entry in fontconfig file " + fcFile.toString());
+ }
return; // bad file
}
fci[index].allFonts = new FontConfigFont[nfonts];
for (int f=0; f<nfonts; f++) {
fci[index].allFonts[f] = new FontConfigFont();
*** 512,521 ****
--- 527,539 ----
String fullName = (String)props.get(fkey);
fci[index].allFonts[f].fullName = fullName;
fkey = key+"."+f+".file";
String file = (String)props.get(fkey);
if (file == null) {
+ if (FontUtilities.debugFonts()) {
+ warning("Missing file value for key " + fkey + " in fontconfig file " + fcFile.toString());
+ }
return; // bad file
}
fci[index].allFonts[f].fontFile = file;
}
fci[index].firstFont = fci[index].allFonts[0];
*** 526,535 ****
--- 544,558 ----
} catch (Throwable t) {
if (FontUtilities.debugFonts()) {
warning(t.toString());
}
}
+
+ if (FontUtilities.debugFonts()) {
+ PlatformLogger logger = FontUtilities.getLogger();
+ logger.info("successfully parsed the fontconfig file at " + fcFile.toString());
+ }
}
private static void warning(String msg) {
PlatformLogger logger = PlatformLogger.getLogger("sun.awt.FontConfiguration");
logger.warning(msg);
< prev index next >