X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fcairo.c;h=a2d5fef9d1ddfd36914ef6f3fa22e55fdcb48424;hb=59981a5060a0e672b98655be240886d89a513d31;hp=9384232841c304f72019abdf403e2449e62dad07;hpb=a2a92dd38cf37e50ccfd56bedd4da21bc56dfe0f;p=pspp diff --git a/src/output/cairo.c b/src/output/cairo.c index 9384232841..a2d5fef9d1 100644 --- a/src/output/cairo.c +++ b/src/output/cairo.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include @@ -57,9 +57,9 @@ top-margin=0.5in bottom-margin=0.5in - prop-font=Times-Roman - emph-font=Times-Italic - fixed-font=Courier + prop-font=serif + emph-font=serif italic + fixed-font=monospace font-size=10000 line-gutter=1pt @@ -389,8 +389,8 @@ handle_option (void *options_, const char *key, const struct string *val) { case -1: error (0, 0, - _("unknown configuration parameter `%s' for Cairo device " - "driver"), key); + _("unknown configuration parameter `%s' for %s device " + "driver"), key, this->class->name); break; case output_file_arg: free (options->file_name); @@ -502,6 +502,27 @@ xr_close_page (struct outp_driver *this) struct xr_driver_ext *x = this->ext; cairo_show_page (x->cairo); } + +static void +xr_output_chart (struct outp_driver *this, const struct chart *chart) +{ + struct xr_driver_ext *x = this->ext; + struct chart_geometry geom; + + outp_eject_page (this); + outp_open_page (this); + + cairo_save (x->cairo); + cairo_translate (x->cairo, 0.0, xr_to_pt (this->length)); + cairo_scale (x->cairo, 1.0, -1.0); + chart_geometry_init (x->cairo, &geom, + xr_to_pt (this->width), xr_to_pt (this->length)); + chart_draw (chart, x->cairo, &geom); + chart_geometry_free (x->cairo); + cairo_restore (x->cairo); + + outp_close_page (this); +} /* Draws a line from (x0,y0) to (x1,y1). */ static void @@ -880,7 +901,7 @@ const struct outp_class cairo_class = xr_close_page, NULL, - NULL, + xr_output_chart, NULL,