< prev index next >
src/java.desktop/unix/classes/sun/font/FontConfigManager.java
Print this page
rev 60042 : 8248802: Add log helper methods to FontUtilities.java
*** 1,7 ****
/*
! * Copyright (c) 2008, 2019, 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
--- 1,7 ----
/*
! * 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
*** 192,217 ****
FontConfigFont anyFont = null;
/* 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);
! }
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.");
! }
fontConfigFailed = true;
return;
} else if (fontConfigFailed) {
for (int i = 0; i< fontArr.length; i++) {
if (fontArr[i].firstFont == null) {
--- 192,210 ----
FontConfigFont anyFont = null;
/* 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) {
! FontUtilities.logInfo("Fontconfig returned no font for " + fontArr[i].fcName);
fontConfigFailed = true;
} else if (anyFont == null) {
anyFont = fci.firstFont;
}
}
if (anyFont == null) {
! FontUtilities.logInfo("Fontconfig returned no fonts at all.");
fontConfigFailed = true;
return;
} else if (fontConfigFailed) {
for (int i = 0; i< fontArr.length; i++) {
if (fontArr[i].firstFont == null) {
*** 221,246 ****
}
fontConfigFonts = fontArr;
if (FontUtilities.isLogging()) {
-
- PlatformLogger logger = FontUtilities.getLogger();
-
long t1 = System.nanoTime();
! logger.info("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 " +
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 +
" Style="+ fcf.styleStr +
" Fullname="+fcf.fullName +
" File="+fcf.fontFile);
}
}
--- 214,236 ----
}
fontConfigFonts = fontArr;
if (FontUtilities.isLogging()) {
long t1 = System.nanoTime();
! FontUtilities.logInfo("Time spent accessing fontconfig="
+ ((t1 - t0) / 1000000) + "ms.");
for (int i = 0; i< fontConfigFonts.length; i++) {
FcCompFont fci = fontConfigFonts[i];
! 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];
! FontUtilities.logInfo("Family=" + fcf.familyName +
" Style="+ fcf.styleStr +
" Fullname="+fcf.fullName +
" File="+fcf.fontFile);
}
}
*** 357,372 ****
}
if (fcInfo == null) {
fcInfo = fontConfigFonts[0];
}
! if (FontUtilities.isLogging()) {
! FontUtilities.getLogger()
! .info("FC name=" + name + " style=" + style +
" uses " + fcInfo.firstFont.familyName +
" in file: " + fcInfo.firstFont.fontFile);
- }
if (fcInfo.compFont != null) {
return fcInfo.compFont;
}
--- 347,359 ----
}
if (fcInfo == null) {
fcInfo = fontConfigFonts[0];
}
! FontUtilities.logInfo("FC name=" + name + " style=" + style +
" uses " + fcInfo.firstFont.familyName +
" in file: " + fcInfo.firstFont.fontFile);
if (fcInfo.compFont != null) {
return fcInfo.compFont;
}
< prev index next >