< prev index next >
src/java.desktop/unix/classes/sun/font/FontConfigManager.java
Print this page
rev 60064 : 8248802: Add log helper methods to FontUtilities.java
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -193,24 +193,21 @@
/* If don't find anything (eg no libfontconfig), then just return */
for (int i = 0; i< fontArr.length; i++) {
FcCompFont fci = fontArr[i];
if (fci.firstFont == null) {
if (FontUtilities.isLogging()) {
- PlatformLogger logger = FontUtilities.getLogger();
- logger.info("Fontconfig returned no font for " +
- fontArr[i].fcName);
+ FontUtilities.logInfo("Fontconfig returned no font for " + fontArr[i].fcName);
}
fontConfigFailed = true;
} else if (anyFont == null) {
anyFont = fci.firstFont;
}
}
if (anyFont == null) {
if (FontUtilities.isLogging()) {
- PlatformLogger logger = FontUtilities.getLogger();
- logger.info("Fontconfig returned no fonts at all.");
+ FontUtilities.logInfo("Fontconfig returned no fonts at all.");
}
fontConfigFailed = true;
return;
} else if (fontConfigFailed) {
for (int i = 0; i< fontArr.length; i++) {
@@ -221,26 +218,23 @@
}
fontConfigFonts = fontArr;
if (FontUtilities.isLogging()) {
-
- PlatformLogger logger = FontUtilities.getLogger();
-
long t1 = System.nanoTime();
- logger.info("Time spent accessing fontconfig="
+ FontUtilities.logInfo("Time spent accessing fontconfig="
+ ((t1 - t0) / 1000000) + "ms.");
for (int i = 0; i< fontConfigFonts.length; i++) {
FcCompFont fci = fontConfigFonts[i];
- logger.info("FC font " + fci.fcName+" maps to family " +
+ FontUtilities.logInfo("FC font " + fci.fcName+" maps to family " +
fci.firstFont.familyName +
" in file " + fci.firstFont.fontFile);
if (fci.allFonts != null) {
for (int f=0;f<fci.allFonts.length;f++) {
FontConfigFont fcf = fci.allFonts[f];
- logger.info("Family=" + fcf.familyName +
+ FontUtilities.logInfo("Family=" + fcf.familyName +
" Style="+ fcf.styleStr +
" Fullname="+fcf.fullName +
" File="+fcf.fontFile);
}
}
@@ -358,12 +352,11 @@
if (fcInfo == null) {
fcInfo = fontConfigFonts[0];
}
if (FontUtilities.isLogging()) {
- FontUtilities.getLogger()
- .info("FC name=" + name + " style=" + style +
+ FontUtilities.logInfo("FC name=" + name + " style=" + style +
" uses " + fcInfo.firstFont.familyName +
" in file: " + fcInfo.firstFont.fontFile);
}
if (fcInfo.compFont != null) {
< prev index next >