33 #include "sun_awt_X11GraphicsEnvironment.h" 34 35 #include "awt_Font.h" 36 37 #include "java_awt_Dimension.h" 38 #include "multi_font.h" 39 #include "Disposer.h" 40 #endif /* !HEADLESS */ 41 #include <jni.h> 42 #ifndef HEADLESS 43 #include <jni_util.h> 44 45 #define defaultXLFD "-*-helvetica-*-*-*-*-12-*-*-*-*-*-iso8859-1" 46 47 struct FontIDs fontIDs; 48 struct PlatformFontIDs platformFontIDs; 49 50 static void pDataDisposeMethod(JNIEnv *env, jlong pData); 51 52 /* #define FONT_DEBUG 2 */ 53 /* 1- print failures, 2- print all, 3- terminate on failure */ 54 #if FONT_DEBUG 55 static XFontStruct *XLoadQueryFontX(Display *display, char *name) 56 { 57 XFontStruct *result = NULL; 58 result = XLoadQueryFont(display, name); 59 #if FONT_DEBUG < 2 60 if (result == NULL) 61 #endif 62 fprintf(stderr, "XLoadQueryFont(\"%s\") -> 0x%x.\n", name, result); 63 #if FONT_DEBUG >= 3 64 if (result == NULL) 65 exit(-1); 66 #endif 67 return result; 68 } 69 #define XLoadQueryFont XLoadQueryFontX 70 #endif 71 #endif /* !HEADLESS */ 72 | 33 #include "sun_awt_X11GraphicsEnvironment.h" 34 35 #include "awt_Font.h" 36 37 #include "java_awt_Dimension.h" 38 #include "multi_font.h" 39 #include "Disposer.h" 40 #endif /* !HEADLESS */ 41 #include <jni.h> 42 #ifndef HEADLESS 43 #include <jni_util.h> 44 45 #define defaultXLFD "-*-helvetica-*-*-*-*-12-*-*-*-*-*-iso8859-1" 46 47 struct FontIDs fontIDs; 48 struct PlatformFontIDs platformFontIDs; 49 50 static void pDataDisposeMethod(JNIEnv *env, jlong pData); 51 52 /* #define FONT_DEBUG 2 */ 53 #ifndef FONT_DEBUG 54 #define FONT_DEBUG 0 55 #endif 56 /* 1- print failures, 2- print all, 3- terminate on failure */ 57 #if FONT_DEBUG 58 static XFontStruct *XLoadQueryFontX(Display *display, char *name) 59 { 60 XFontStruct *result = NULL; 61 result = XLoadQueryFont(display, name); 62 #if FONT_DEBUG < 2 63 if (result == NULL) 64 #endif 65 fprintf(stderr, "XLoadQueryFont(\"%s\") -> 0x%x.\n", name, result); 66 #if FONT_DEBUG >= 3 67 if (result == NULL) 68 exit(-1); 69 #endif 70 return result; 71 } 72 #define XLoadQueryFont XLoadQueryFontX 73 #endif 74 #endif /* !HEADLESS */ 75 |