src/solaris/native/sun/awt/fontpath.c

Print this page
rev 8336 : 8025673: [macosx] Disable X11 AWT toolkit
Summary: Disable but not completely remove the XAWT and headless toolkits on Mac OS X
Reviewed-by:
Contributed-by: david.dehaven@oracle.com

@@ -21,11 +21,11 @@
  * 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.
  */
 
-#if defined(__linux__) || defined(MACOSX)
+#if defined(__linux__)
 #include <string.h>
 #endif /* __linux__ */
 #include <stdio.h>
 #include <stdlib.h>
 #include <strings.h>

@@ -57,30 +57,16 @@
 
 #ifndef HEADLESS
 extern Display *awt_display;
 #endif /* !HEADLESS */
 
-#ifdef MACOSX
-
-//
-// XXXDARWIN: Hard-code the path to Apple's fontconfig, as it is
-// not included in the dyld search path by default, and 10.4
-// does not support -rpath.
-//
-// This ignores the build time setting of ALT_FREETYPE_LIB_PATH,
-// and should be replaced with -rpath/@rpath support on 10.5 or later,
-// or via support for a the FREETYPE_LIB_PATH define.
-#define FONTCONFIG_DLL_VERSIONED X11_PATH "/lib/" VERSIONED_JNI_LIB_NAME("fontconfig", "1")
-#define FONTCONFIG_DLL X11_PATH "/lib/" JNI_LIB_NAME("fontconfig")
-#else
 #define FONTCONFIG_DLL_VERSIONED VERSIONED_JNI_LIB_NAME("fontconfig", "1")
 #define FONTCONFIG_DLL JNI_LIB_NAME("fontconfig")
-#endif
 
 #define MAXFDIRS 512    /* Max number of directories that contain fonts */
 
-#if !defined(__linux__) && !defined(MACOSX)
+#if !defined(__linux__)
 /*
  * This can be set in the makefile to "/usr/X11" if so desired.
  */
 #ifndef OPENWINHOMELIB
 #define OPENWINHOMELIB "/usr/openwin/lib/"

@@ -126,26 +112,10 @@
     OPENWINHOMELIB "locale/iso_8859_13/X11/fonts/Type1",
     OPENWINHOMELIB "locale/ar/X11/fonts/Type1",
     NULL, /* terminates the list */
 };
 
-#elif MACOSX
-static char *full_MACOSX_X11FontPath[] = {
-    X11_PATH "/lib/X11/fonts/TrueType",
-    X11_PATH "/lib/X11/fonts/truetype",
-    X11_PATH "/lib/X11/fonts/tt",
-    X11_PATH "/lib/X11/fonts/TTF",
-    X11_PATH "/lib/X11/fonts/OTF",
-    PACKAGE_PATH "/share/fonts/TrueType",
-    PACKAGE_PATH "/share/fonts/truetype",
-    PACKAGE_PATH "/share/fonts/tt",
-    PACKAGE_PATH "/share/fonts/TTF",
-    PACKAGE_PATH "/share/fonts/OTF",
-    X11_PATH "/lib/X11/fonts/Type1",
-    PACKAGE_PATH "/share/fonts/Type1",
-    NULL, /* terminates the list */
-};
 #else /* __linux */
 /* All the known interesting locations we have discovered on
  * various flavors of Linux
  */
 static char *fullLinuxFontPath[] = {

@@ -398,11 +368,11 @@
 }
 
 
 #endif /* !HEADLESS */
 
-#if defined(__linux__) || defined(MACOSX)
+#if defined(__linux__)
 /* from awt_LoadLibrary.c */
 JNIEXPORT jboolean JNICALL AWTIsHeadless();
 #endif
 
 /* This eliminates duplicates, at a non-linear but acceptable cost

@@ -525,23 +495,21 @@
      */
     fcdirs = getFontConfigLocations();
 
 #if defined(__linux__)
     knowndirs = fullLinuxFontPath;
-#elif defined(MACOSX)
-    knowndirs = full_MACOSX_X11FontPath;
 #else /* IF SOLARIS */
     knowndirs = fullSolarisFontPath;
 #endif
 
     /* REMIND: this code requires to be executed when the GraphicsEnvironment
      * is already initialised. That is always true, but if it were not so,
      * this code could throw an exception and the fontpath would fail to
      * be initialised.
      */
 #ifndef HEADLESS
-#if defined(__linux__) || defined(MACOSX)
+#if defined(__linux__)
     /* There's no headless build on linux ... */
     if (!AWTIsHeadless()) { /* .. so need to call a function to check */
 #endif
       /* Using the X11 font path to locate font files is now a fallback
        * useful only if fontconfig failed, or is incomplete. So we could

@@ -553,11 +521,11 @@
     AWT_LOCK();
     if (isDisplayLocal(env)) {
         x11dirs = getX11FontPath();
     }
     AWT_UNLOCK();
-#if defined(__linux__) || defined(MACOSX)
+#if defined(__linux__)
     }
 #endif
 #endif /* !HEADLESS */
     path = mergePaths(fcdirs, x11dirs, knowndirs, noType1);
     if (fcdirs != NULL) {