printing works; font sizes are weird
[pspp] / src / output / cairo.c
index 16738897130a2c8d951faee4f951a2baef257042..a85054ebccc0ca5f6fd78d8a5264df8ac0556ddd 100644 (file)
@@ -238,16 +238,12 @@ xr_allocate (const char *name, int device_type, struct string_map *o,
   *xr->page_style = (struct xr_page_style) {
     .ref_cnt = 1,
 
-    .size = { [H] = size[H], [V] = size[V] },
     .margins = {
       [H] = { margins[H][0], margins[H][1], },
       [V] = { margins[V][0], margins[V][1], },
     },
 
-    .font = pango_font_description_copy (proportional_font),
-
     .bg = bg,
-    .font_scale = font_scale,
     .initial_page_number = 1,
     .object_spacing = object_spacing,
   };
@@ -279,7 +275,8 @@ xr_create (struct file_handle *fh, enum settings_output_devices device_type,
 
   double paper[TABLE_N_AXES];
   for (int a = 0; a < TABLE_N_AXES; a++)
-    paper[a] = xr_to_pt (xr_page_style_paper_size (xr->page_style, a));
+    paper[a] = xr_to_pt (xr_page_style_paper_size (xr->page_style,
+                                                   xr->fsm_style, a));
   if (file_type == XR_PDF)
     xr->surface = cairo_pdf_surface_create (file_name, paper[H], paper[V]);
   else if (file_type == XR_PS)
@@ -374,19 +371,12 @@ xr_update_page_setup (struct output_driver *driver,
   *page_style = (struct xr_page_style) {
     .ref_cnt = 1,
 
-    .size = {
-      [H] = (ps->paper[h] - ps->margins[h][0] - ps->margins[h][1]) * scale,
-      [V] = (ps->paper[v] - ps->margins[v][0] - ps->margins[v][1]) * scale,
-    },
     .margins = {
       [H] = { ps->margins[h][0] * scale, ps->margins[h][1] * scale },
       [V] = { ps->margins[v][0] * scale, ps->margins[v][1] * scale },
     },
 
-    .font = pango_font_description_copy (xr->page_style->font),
-
     .bg = xr->page_style->bg,
-    .font_scale = xr->page_style->font_scale,
     .initial_page_number = ps->initial_page_number,
     .object_spacing = ps->object_spacing * 72 * XR_POINT,
   };
@@ -412,11 +402,11 @@ xr_submit (struct output_driver *driver, const struct output_item *output_item)
 
   if (!xr->pager)
     {
-      xr->pager = xr_pager_create (xr->page_style);
+      xr->pager = xr_pager_create (xr->page_style, xr->fsm_style);
       xr_pager_add_page (xr->pager, cairo_create (xr->surface));
     }
 
-  xr_pager_add_item (xr->pager, xr->fsm_style, output_item);
+  xr_pager_add_item (xr->pager, output_item);
   while (xr_pager_needs_new_page (xr->pager))
     {
       cairo_surface_show_page (xr->surface);