/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/** Version of the cache file format understood by this code.
* Its part of the file name so that we can rev this at
* any time, even in a minor JDK update.
* It is stored as the value of the "version" property.
* This is distinct from the version of "libfontconfig" that generated
* the cached results, and which is the "fcversion" property in the file.
* {@code FontConfiguration.getVersion()} also returns a version string,
* and has meant the version of the fontconfiguration.properties file
* that was read. Since this class doesn't use such files, then what
* that really means is whether the methods on this class return
* values that are compatible with the classes that do directly read
* from such files. It is a compatible subset of version "1".
*/
super(fm);
init();
}
/* This isn't called but is needed to satisfy super-class contract. */
boolean preferLocaleFonts,
boolean preferPropFonts) {
init();
}
public synchronized boolean init() {
if (fcCompFonts != null) {
return true;
}
readFcInfo();
if (fcCompFonts == null) {
if (fcCompFonts != null) {
try {
writeFcInfo();
} catch (Exception e) {
if (FontUtilities.debugFonts()) {
warning("Exception writing fcInfo " + e);
}
}
} else if (FontUtilities.debugFonts()) {
warning("Failed to get info from libfontconfig");
}
} else {
}
if (fcCompFonts == null) {
return false; // couldn't load fontconfig.
}
// NB already in a privileged block from SGE
throw new Error("java.home property not set");
}
return true;
}
// maintain compatibility with old font.properties files, which either
// had aliases for TimesRoman & Co. or defined mappings for them.
if (compatibilityName != null) {
return compatibilityName;
}
return defaultFallback;
}
protected String
return null;
}
protected String
return null;
}
/* Platform name is the file name, but rather than returning
* the arg, return null*/
return null;
}
}
return "default";
}
protected void initReorderMap() {
reorderMap = new HashMap();
}
return new FontDescriptor[0];
}
public int getNumberCoreFonts() {
return 1;
}
}
}
}
return null;
}
return false;
}
fontname = "sansserif";
fontname = "monospaced";
}
}
}
}
if (installedFallbackFontFiles != null) {
}
int index;
}
if (installedFallbackFontFiles != null) {
}
= new CompositeFontDescriptor(
1,
null,
}
}
return result;
}
/**
* Gets the OS version string from a Linux release-specific file.
*/
try {
}
catch (Exception e){
}
return null;
}
/**
* Sets the OS name and version from environment information.
*/
protected void setOsNameAndVersion() {
super.setOsNameAndVersion();
return;
}
try {
File f;
/* Ubuntu and (perhaps others) use only lsb-release.
* Syntax and encoding is compatible with java properties.
* For Ubuntu the ID is "Ubuntu".
*/
osName = "RedHat";
osVersion = getVersionString(f);
osName = "SuSE";
osVersion = getVersionString(f);
osName = "Turbo";
osVersion = getVersionString(f);
osName = "Fedora";
osVersion = getVersionString(f);
}
} catch (Exception e) {
if (FontUtilities.debugFonts()) {
warning("Exception identifying Linux distro.");
}
}
}
if (fcInfoFileName == null) {
// NB need security permissions to get true IP address, and
// we should have those as the whole initialisation is in a
// doPrivileged block. But in this case no exception is thrown,
// and it returns the loop back address, and so we end up with
// "localhost"
try {
} catch (UnknownHostException e) {
hostname = "localhost";
}
}
return new File(fcInfoFileName);
}
private void writeFcInfo() {
}
}
}
}
}
try {
/* This writes into a temp file then renames when done.
* Since the rename is an atomic action within the same
* directory no client will ever see a partially written file.
*/
"JDK Font Configuration Generated File: *Do Not Edit*");
}
} catch (Exception e) {
if (FontUtilities.debugFonts()) {
}
}
}
/* We want to be able to use this cache instead of invoking
* fontconfig except when we can detect the system cache has changed.
* But there doesn't seem to be a way to find the location of
* the system cache.
*/
private void readFcInfo() {
return;
}
try {
} catch (IOException e) {
if (FontUtilities.debugFonts()) {
}
return;
}
return;
}
// If there's a new, different fontconfig installed on the
// system, we invalidate our fontconfig file.
if (fcVersionStr != null) {
int fcVersion;
try {
if (fcVersion != 0 &&
return;
}
} catch (Exception e) {
if (FontUtilities.debugFonts()) {
}
return;
}
}
// If we can locate the fontconfig cache dirs, then compare the
// time stamp of those with our properties file. If we are out
// of date then re-generate.
int cacheDirIndex = 0;
break;
}
return;
}
}
int numStyles = 4;
try {
for (int i=0; i<namesLen; i++) {
for (int s=0; s<numStyles; s++) {
if (nfonts <= 0) {
return; // bad file
}
for (int f=0; f<nfonts; f++) {
return; // bad file
}
}
}
}
fcCompFonts = fci;
} catch (Throwable t) {
if (FontUtilities.debugFonts()) {
}
}
}
}
}