X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=libchimara%2Fwindow.c;h=edb241f88a4c34fdf34369409c3da24ecccbae3d;hb=0c75df5f3c9b9dce26f54dfceaefd71a48a8a392;hp=87264c1156a418bdee1692bd46df49ebecdb4017;hpb=90d9bcd52209de846b5f96e5ad79b399c03d4fb1;p=rodin%2Fchimara.git diff --git a/libchimara/window.c b/libchimara/window.c index 87264c1..edb241f 100644 --- a/libchimara/window.c +++ b/libchimara/window.c @@ -474,15 +474,16 @@ glk_window_open(winid_t split, glui32 method, glui32 size, glui32 wintype, gtk_text_view_set_editable( GTK_TEXT_VIEW(textview), FALSE ); gtk_widget_show(textview); - /* Set the window's font */ - gtk_widget_modify_font(textview, glk_data->monospace_font_desc); + /* Create the styles available to the window stream */ + style_init_textgrid(textbuffer); + gtk_widget_modify_font( textview, get_current_font(wintype) ); win->widget = textview; win->frame = textview; /* Determine the size of a "0" character in pixels */ PangoLayout *zero = gtk_widget_create_pango_layout(textview, "0"); - pango_layout_set_font_description(zero, glk_data->monospace_font_desc); + pango_layout_set_font_description( zero, get_current_font(wintype) ); pango_layout_get_pixel_size(zero, &(win->unit_width), &(win->unit_height)); g_object_unref(zero); /* width and height are set later */ @@ -496,9 +497,6 @@ glk_window_open(winid_t split, glui32 method, glui32 size, glui32 wintype, gtk_widget_add_events( textview, GDK_BUTTON_RELEASE_MASK ); win->mouse_click_handler = g_signal_connect_after( G_OBJECT(textview), "button-release-event", G_CALLBACK(on_window_button_release_event), win ); g_signal_handler_block( textview, win->mouse_click_handler ); - - /* Create the styles available to the window stream */ - style_init_textgrid(textbuffer); } break; @@ -519,15 +517,16 @@ glk_window_open(winid_t split, glui32 method, glui32 size, glui32 wintype, gtk_container_add( GTK_CONTAINER(scrolledwindow), textview ); gtk_widget_show_all(scrolledwindow); - /* Set the window's font */ - gtk_widget_modify_font(textview, glk_data->default_font_desc); + /* Create the styles available to the window stream */ + style_init_textbuffer(textbuffer); + gtk_widget_modify_font( textview, get_current_font(wintype) ); win->widget = textview; win->frame = scrolledwindow; /* Determine the size of a "0" character in pixels */ PangoLayout *zero = gtk_widget_create_pango_layout(textview, "0"); - pango_layout_set_font_description(zero, glk_data->default_font_desc); + pango_layout_set_font_description( zero, get_current_font(wintype) ); pango_layout_get_pixel_size(zero, &(win->unit_width), &(win->unit_height)); g_object_unref(zero); @@ -548,9 +547,6 @@ glk_window_open(winid_t split, glui32 method, glui32 size, glui32 wintype, (for line input) */ gtk_text_buffer_create_tag(textbuffer, "uneditable", "editable", FALSE, "editable-set", TRUE, NULL); - /* Create the styles available to the window stream */ - style_init_textbuffer(textbuffer); - /* Mark the position where the user will input text */ GtkTextIter end; gtk_text_buffer_get_end_iter(textbuffer, &end);