< prev index next >
src/java.desktop/unix/native/common/awt/fontpath.c
Print this page
rev 59383 : [mq]: final
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -32,13 +32,10 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
-#ifdef __solaris__
-#include <sys/systeminfo.h>
-#endif
#include <jni.h>
#include <jni_util.h>
#include <jvm_md.h>
#include <sizecalc.h>
@@ -62,61 +59,11 @@
#define FONTCONFIG_DLL_VERSIONED VERSIONED_JNI_LIB_NAME("fontconfig", "1")
#define FONTCONFIG_DLL JNI_LIB_NAME("fontconfig")
#define MAXFDIRS 512 /* Max number of directories that contain fonts */
-#if defined(__solaris__)
-/*
- * This can be set in the makefile to "/usr/X11" if so desired.
- */
-#ifndef OPENWINHOMELIB
-#define OPENWINHOMELIB "/usr/openwin/lib/"
-#endif
-
-/* This is all known Solaris X11 directories on Solaris 8, 9 and 10.
- * It is ordered to give precedence to TrueType directories.
- * It is needed if fontconfig is not installed or configured properly.
- */
-static char *fullSolarisFontPath[] = {
- OPENWINHOMELIB "X11/fonts/TrueType",
- OPENWINHOMELIB "locale/euro_fonts/X11/fonts/TrueType",
- OPENWINHOMELIB "locale/iso_8859_2/X11/fonts/TrueType",
- OPENWINHOMELIB "locale/iso_8859_5/X11/fonts/TrueType",
- OPENWINHOMELIB "locale/iso_8859_7/X11/fonts/TrueType",
- OPENWINHOMELIB "locale/iso_8859_8/X11/fonts/TrueType",
- OPENWINHOMELIB "locale/iso_8859_9/X11/fonts/TrueType",
- OPENWINHOMELIB "locale/iso_8859_13/X11/fonts/TrueType",
- OPENWINHOMELIB "locale/iso_8859_15/X11/fonts/TrueType",
- OPENWINHOMELIB "locale/ar/X11/fonts/TrueType",
- OPENWINHOMELIB "locale/hi_IN.UTF-8/X11/fonts/TrueType",
- OPENWINHOMELIB "locale/ja/X11/fonts/TT",
- OPENWINHOMELIB "locale/ko/X11/fonts/TrueType",
- OPENWINHOMELIB "locale/ko.UTF-8/X11/fonts/TrueType",
- OPENWINHOMELIB "locale/KOI8-R/X11/fonts/TrueType",
- OPENWINHOMELIB "locale/ru.ansi-1251/X11/fonts/TrueType",
- OPENWINHOMELIB "locale/th_TH/X11/fonts/TrueType",
- OPENWINHOMELIB "locale/zh_TW/X11/fonts/TrueType",
- OPENWINHOMELIB "locale/zh_TW.BIG5/X11/fonts/TT",
- OPENWINHOMELIB "locale/zh_HK.BIG5HK/X11/fonts/TT",
- OPENWINHOMELIB "locale/zh_CN.GB18030/X11/fonts/TrueType",
- OPENWINHOMELIB "locale/zh/X11/fonts/TrueType",
- OPENWINHOMELIB "locale/zh.GBK/X11/fonts/TrueType",
- OPENWINHOMELIB "X11/fonts/Type1",
- OPENWINHOMELIB "X11/fonts/Type1/sun",
- OPENWINHOMELIB "X11/fonts/Type1/sun/outline",
- OPENWINHOMELIB "locale/iso_8859_2/X11/fonts/Type1",
- OPENWINHOMELIB "locale/iso_8859_4/X11/fonts/Type1",
- OPENWINHOMELIB "locale/iso_8859_5/X11/fonts/Type1",
- OPENWINHOMELIB "locale/iso_8859_7/X11/fonts/Type1",
- OPENWINHOMELIB "locale/iso_8859_8/X11/fonts/Type1",
- OPENWINHOMELIB "locale/iso_8859_9/X11/fonts/Type1",
- OPENWINHOMELIB "locale/iso_8859_13/X11/fonts/Type1",
- OPENWINHOMELIB "locale/ar/X11/fonts/Type1",
- NULL, /* terminates the list */
-};
-
-#elif defined( __linux__)
+#if defined( __linux__)
/* All the known interesting locations we have discovered on
* various flavors of Linux
*/
static char *fullLinuxFontPath[] = {
"/usr/X11R6/lib/X11/fonts/TrueType", /* RH 7.1+ */
@@ -362,18 +309,10 @@
continue;
}
if (strstr(x11Path[i], ".gnome") != NULL) {
continue;
}
-#ifdef __solaris__
- if (strstr(x11Path[i], "/F3/") != NULL) {
- continue;
- }
- if (strstr(x11Path[i], "bitmap") != NULL) {
- continue;
- }
-#endif
fontdirs[pos] = strdup(x11Path[i]);
slen = strlen(fontdirs[pos]);
if (slen > 0 && fontdirs[pos][slen-1] == '/') {
fontdirs[pos][slen-1] = '\0'; /* null out trailing "/" */
}
@@ -519,12 +458,10 @@
*/
fcdirs = getFontConfigLocations();
#if defined(__linux__)
knowndirs = fullLinuxFontPath;
-#elif defined(__solaris__)
- knowndirs = fullSolarisFontPath;
#elif defined(_AIX)
knowndirs = fullAixFontPath;
#endif
/* REMIND: this code requires to be executed when the GraphicsEnvironment
* is already initialised. That is always true, but if it were not so,
@@ -590,38 +527,19 @@
static void* openFontConfig() {
char *homeEnv;
static char *homeEnvStr = "HOME="; /* must be static */
void* libfontconfig = NULL;
-#ifdef __solaris__
-#define SYSINFOBUFSZ 8
- char sysinfobuf[SYSINFOBUFSZ];
-#endif
/* Private workaround to not use fontconfig library.
* May be useful during testing/debugging
*/
char *useFC = getenv("USE_J2D_FONTCONFIG");
if (useFC != NULL && !strcmp(useFC, "no")) {
return NULL;
}
-#ifdef __solaris__
- /* fontconfig is likely not properly configured on S8/S9 - skip it,
- * although allow user to override this behaviour with an env. variable
- * ie if USE_J2D_FONTCONFIG=yes then we skip this test.
- * NB "4" is the length of a string which matches our patterns.
- */
- if (useFC == NULL || strcmp(useFC, "yes")) {
- if (sysinfo(SI_RELEASE, sysinfobuf, SYSINFOBUFSZ) == 4) {
- if ((!strcmp(sysinfobuf, "5.8") || !strcmp(sysinfobuf, "5.9"))) {
- return NULL;
- }
- }
- }
-#endif
-
#if defined(_AIX)
/* On AIX, fontconfig is not a standard package supported by IBM.
* instead it has to be installed from the "AIX Toolbox for Linux Applications"
* site http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/alpha.html
* and will be installed under /opt/freeware/lib/libfontconfig.a.
< prev index next >