cairo: Fix font scaling.
[pspp] / src / output / text-item.c
index 283bfaed49d08001a1ea9c0dfca4d1fafd84a18a..ba0f3873adb0071f2dc996f62b3846d2117ccf02 100644 (file)
@@ -18,7 +18,6 @@
 
 #include "output/text-item.h"
 
-#include <assert.h>
 #include <stdarg.h>
 #include <stdlib.h>
 
@@ -26,7 +25,7 @@
 #include "libpspp/pool.h"
 #include "output/driver.h"
 #include "output/output-item-provider.h"
-#include "output/tab.h"
+#include "output/table.h"
 #include "output/table-item.h"
 #include "output/table-provider.h"
 
@@ -120,10 +119,11 @@ text_item_submit (struct text_item *item)
 struct table_item *
 text_item_to_table_item (struct text_item *text_item)
 {
-  struct tab_table *tab = tab_create (1, 1);
+  struct table *tab = table_create (1, 1, 0, 0, 0, 0);
 
   struct area_style *style = pool_alloc (tab->container, sizeof *style);
-  *style = (struct area_style) AREA_STYLE_INITIALIZER;
+  *style = (struct area_style) { AREA_STYLE_INITIALIZER__,
+                                 .cell_style.halign = TABLE_HALIGN_LEFT };
   struct font_style *font_style = &style->font_style;
   if (text_item->typeface)
     font_style->typeface = pool_strdup (tab->container, text_item->typeface);
@@ -134,13 +134,13 @@ text_item_to_table_item (struct text_item *text_item)
   font_style->markup = text_item->markup;
   tab->styles[0] = style;
 
-  int opts = TAB_LEFT;
+  int opts = 0;
   if (text_item->markup)
     opts |= TAB_MARKUP;
   if (text_item->type == TEXT_ITEM_SYNTAX || text_item->type == TEXT_ITEM_LOG)
     opts |= TAB_FIX;
-  tab_text (tab, 0, 0, opts, text_item_get_text (text_item));
-  struct table_item *table_item = table_item_create (&tab->table, NULL, NULL);
+  table_text (tab, 0, 0, opts, text_item_get_text (text_item));
+  struct table_item *table_item = table_item_create (tab, NULL, NULL);
   text_item_unref (text_item);
   return table_item;
 }