< prev index next >

src/java.desktop/unix/native/common/awt/fontpath.c

Print this page




 561         free(x11dirs);
 562     }
 563 
 564     return path;
 565 }
 566 
 567 JNIEXPORT jstring JNICALL Java_sun_awt_FcFontManager_getFontPathNative
 568 (JNIEnv *env, jobject thiz, jboolean noType1, jboolean isX11) {
 569     jstring ret;
 570     static char *ptr = NULL; /* retain result across calls */
 571 
 572     if (ptr == NULL) {
 573         ptr = getPlatformFontPathChars(env, noType1, isX11);
 574     }
 575     ret = (*env)->NewStringUTF(env, ptr);
 576     return ret;
 577 }
 578 
 579 #include <dlfcn.h>
 580 
 581 #include "fontconfig.h"
 582 
 583 
 584 static void* openFontConfig() {
 585 
 586     char *homeEnv;
 587     static char *homeEnvStr = "HOME="; /* must be static */
 588     void* libfontconfig = NULL;
 589 #ifdef __solaris__
 590 #define SYSINFOBUFSZ 8
 591     char sysinfobuf[SYSINFOBUFSZ];
 592 #endif
 593 
 594     /* Private workaround to not use fontconfig library.
 595      * May be useful during testing/debugging
 596      */
 597     char *useFC = getenv("USE_J2D_FONTCONFIG");
 598     if (useFC != NULL && !strcmp(useFC, "no")) {
 599         return NULL;
 600     }
 601 




 561         free(x11dirs);
 562     }
 563 
 564     return path;
 565 }
 566 
 567 JNIEXPORT jstring JNICALL Java_sun_awt_FcFontManager_getFontPathNative
 568 (JNIEnv *env, jobject thiz, jboolean noType1, jboolean isX11) {
 569     jstring ret;
 570     static char *ptr = NULL; /* retain result across calls */
 571 
 572     if (ptr == NULL) {
 573         ptr = getPlatformFontPathChars(env, noType1, isX11);
 574     }
 575     ret = (*env)->NewStringUTF(env, ptr);
 576     return ret;
 577 }
 578 
 579 #include <dlfcn.h>
 580 
 581 #include <fontconfig/fontconfig.h>
 582 
 583 
 584 static void* openFontConfig() {
 585 
 586     char *homeEnv;
 587     static char *homeEnvStr = "HOME="; /* must be static */
 588     void* libfontconfig = NULL;
 589 #ifdef __solaris__
 590 #define SYSINFOBUFSZ 8
 591     char sysinfobuf[SYSINFOBUFSZ];
 592 #endif
 593 
 594     /* Private workaround to not use fontconfig library.
 595      * May be useful during testing/debugging
 596      */
 597     char *useFC = getenv("USE_J2D_FONTCONFIG");
 598     if (useFC != NULL && !strcmp(useFC, "no")) {
 599         return NULL;
 600     }
 601 


< prev index next >