X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-output-window.c;h=658d36a4669f7d9aecb236a25214678ead7f4444;hb=4142c5a08fc22235c21f686f2979a4c1c83741b7;hp=4bf8ce5b287918488249cd7df3af47448047d89d;hpb=c0a213f7ed487273797d579bad952bca983240ba;p=pspp diff --git a/src/ui/gui/psppire-output-window.c b/src/ui/gui/psppire-output-window.c index 4bf8ce5b28..658d36a466 100644 --- a/src/ui/gui/psppire-output-window.c +++ b/src/ui/gui/psppire-output-window.c @@ -149,6 +149,7 @@ struct psppire_output_driver struct output_driver driver; PsppireOutputWindow *viewer; struct xr_driver *xr; + int font_height; }; static struct output_driver_class psppire_output_class; @@ -222,8 +223,10 @@ psppire_output_submit (struct output_driver *this, { const GtkStyle *style = gtk_widget_get_style (GTK_WIDGET (viewer)); struct string_map options = STRING_MAP_INITIALIZER (options); + struct text_item *text_item; PangoFontDescription *font_desc; char *font_name; + int font_width; /* Use GTK+ default font as proportional font. */ font_name = pango_font_description_to_string (style->font_desc); @@ -252,7 +255,15 @@ psppire_output_submit (struct output_driver *this, pod->xr = xr_driver_create (cr, &options); string_map_destroy (&options); + + text_item = text_item_create (TEXT_ITEM_PARAGRAPH, "X"); + r = xr_rendering_create (pod->xr, text_item_super (text_item), cr); + xr_rendering_measure (r, &font_width, &pod->font_height); + /* xr_rendering_destroy (r); */ + text_item_unref (text_item); } + else + pod->viewer->y += pod->font_height / 2; r = xr_rendering_create (pod->xr, item, cr); if (r == NULL)