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

Print this page
rev 7983 : 8024854: Basic changes and files to build the class library on AIX
Contributed-by: luchsh@linux.vnet.ibm.com, spoole@linux.vnet.ibm.com, thomas.stuefe@sap.com
Reviewed-by:

*** 1,7 **** /* ! * Copyright (c) 1998, 2011, 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) 1998, 2013, 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
*** 76,86 **** #define FONTCONFIG_DLL JNI_LIB_NAME("fontconfig") #endif #define MAXFDIRS 512 /* Max number of directories that contain fonts */ ! #if !defined(__linux__) && !defined(MACOSX) /* * This can be set in the makefile to "/usr/X11" if so desired. */ #ifndef OPENWINHOMELIB #define OPENWINHOMELIB "/usr/openwin/lib/" --- 76,86 ---- #define FONTCONFIG_DLL JNI_LIB_NAME("fontconfig") #endif #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/"
*** 126,136 **** 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", --- 126,136 ---- OPENWINHOMELIB "locale/iso_8859_13/X11/fonts/Type1", OPENWINHOMELIB "locale/ar/X11/fonts/Type1", NULL, /* terminates the list */ }; ! #elif defined(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",
*** 142,152 **** 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[] = { "/usr/X11R6/lib/X11/fonts/TrueType", /* RH 7.1+ */ --- 142,152 ---- PACKAGE_PATH "/share/fonts/OTF", X11_PATH "/lib/X11/fonts/Type1", PACKAGE_PATH "/share/fonts/Type1", NULL, /* terminates the list */ }; ! #elif 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+ */
*** 162,171 **** --- 162,179 ---- "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType", /* Debian */ "/usr/X11R6/lib/X11/fonts/Type1", "/usr/share/fonts/default/Type1", /* RH 9.0 */ NULL, /* terminates the list */ }; + #elif defined(AIX) + /* Very basic start for AIX - feel free to complete .. + */ + static char *fullAixFontPath[] = { + "/usr/lib/X11/fonts/TrueType", /* */ + "/usr/lib/X11/fonts/Type1", /* */ + NULL, /* terminates the list */ + }; #endif static char **getFontConfigLocations(); typedef struct {
*** 527,538 **** #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 --- 535,548 ---- #if defined(__linux__) knowndirs = fullLinuxFontPath; #elif defined(MACOSX) knowndirs = full_MACOSX_X11FontPath; ! #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, * this code could throw an exception and the fontpath would fail to
*** 622,631 **** --- 632,660 ---- return NULL; } } } #endif + + #if defined(AIX) + /* On AIX, fontconfig is not a standard package supported by IBM. + * insted 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. + * Notice that the archive contains the real 32- and 64-bit shared libraries. + * We first try to load 'libfontconfig.so' from the default library path in the + * case the user has installed a private version of the library and if that + * doesn't succeed, we try the version from /opt/freeware/lib/libfontconfig.a + */ + libfontconfig = dlopen("libfontconfig.so", RTLD_LOCAL|RTLD_LAZY); + if (libfontconfig == NULL) { + libfontconfig = dlopen("/opt/freeware/lib/libfontconfig.a(libfontconfig.so.1)", RTLD_MEMBER|RTLD_LOCAL|RTLD_LAZY); + if (libfontconfig == NULL) { + return NULL; + } + } + #else /* 64 bit sparc should pick up the right version from the lib path. * New features may be added to libfontconfig, this is expected to * be compatible with old features, but we may need to start * distinguishing the library version, to know whether to expect * certain symbols - and functionality - to be available.
*** 636,645 **** --- 665,675 ---- libfontconfig = dlopen(FONTCONFIG_DLL, RTLD_LOCAL|RTLD_LAZY); if (libfontconfig == NULL) { return NULL; } } + #endif /* Version 1.0 of libfontconfig crashes if HOME isn't defined in * the environment. This should generally never happen, but we can't * control it, and can't control the version of fontconfig, so iff * its not defined we set it to an empty value which is sufficient
*** 1233,1243 **** * on Type 1 fonts for some Locale support, so we'll allow * them there. */ if (fontformat != NULL && (strcmp((char*)fontformat, "TrueType") != 0) ! #ifdef __linux__ && (strcmp((char*)fontformat, "Type 1") != 0) #endif ) { continue; } --- 1263,1273 ---- * on Type 1 fonts for some Locale support, so we'll allow * them there. */ if (fontformat != NULL && (strcmp((char*)fontformat, "TrueType") != 0) ! #if defined(__linux__) || defined(AIX) && (strcmp((char*)fontformat, "Type 1") != 0) #endif ) { continue; }