57 |
gdk_threads_leave (); |
gdk_threads_leave (); |
58 |
} |
} |
59 |
|
|
60 |
|
JNIEXPORT void JNICALL |
61 |
|
Java_gnu_java_awt_peer_gtk_GtkGenericPeer_gtkWidgetModifyFont |
62 |
|
(JNIEnv *env, jobject obj, jstring name, jint style, jint size) |
63 |
|
{ |
64 |
|
const char *font_name; |
65 |
|
void *ptr; |
66 |
|
PangoFontDescription *font_desc; |
67 |
|
|
68 |
|
ptr = NSA_GET_PTR (env, obj); |
69 |
|
|
70 |
|
font_name = (*env)->GetStringUTFChars (env, name, NULL); |
71 |
|
|
72 |
|
gdk_threads_enter(); |
73 |
|
|
74 |
|
font_desc = pango_font_description_from_string (font_name); |
75 |
|
pango_font_description_set_size (font_desc, size * dpi_conversion_factor); |
76 |
|
|
77 |
|
if (style & AWT_STYLE_BOLD) |
78 |
|
pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD); |
79 |
|
|
80 |
|
if (style & AWT_STYLE_ITALIC) |
81 |
|
pango_font_description_set_style (font_desc, PANGO_STYLE_OBLIQUE); |
82 |
|
|
83 |
|
gtk_widget_modify_font (GTK_WIDGET(ptr), font_desc); |
84 |
|
|
85 |
|
pango_font_description_free (font_desc); |
86 |
|
|
87 |
|
gdk_threads_leave(); |
88 |
|
|
89 |
|
(*env)->ReleaseStringUTFChars (env, name, font_name); |
90 |
|
} |