output: Cache the script ltr versus rtl direction.
[pspp] / src / output / cairo.c
index 3e824607f2377f6fb0ed0f0f67a7e684df96c219..61944624a7ee088f040349e591ada53edd4468ba 100644 (file)
@@ -39,6 +39,7 @@
 #include "output/charts/scree.h"
 #include "output/charts/scatterplot.h"
 #include "output/driver-provider.h"
+#include "output/group-item.h"
 #include "output/message-item.h"
 #include "output/options.h"
 #include "output/render.h"
@@ -71,7 +72,8 @@
 #define H TABLE_HORZ
 #define V TABLE_VERT
 
-/* The unit used for internal measurements is inch/(72 * XR_POINT). */
+/* The unit used for internal measurements is inch/(72 * XR_POINT).
+   (Thus, XR_POINT units represent one point.) */
 #define XR_POINT PANGO_SCALE
 
 /* Conversions to and from points. */
@@ -423,6 +425,7 @@ xr_set_cairo (struct xr_driver *xr, cairo_t *cairo)
       for (i = 0; i < TABLE_N_AXES; i++)
         xr->params->min_break[i] = xr->min_break[i];
       xr->params->supports_margins = true;
+      xr->params->rtl = render_direction_rtl ();
     }
 
   cairo_set_source_rgb (xr->cairo, xr->fg.red, xr->fg.green, xr->fg.blue);
@@ -1405,6 +1408,9 @@ xr_rendering_create (struct xr_driver *xr, const struct output_item *item,
       r = xzalloc (sizeof *r);
       r->item = output_item_ref (item);
     }
+  else if (is_group_open_item (item))
+    r = xr_rendering_create_text (xr, to_group_open_item (item)->command_name,
+                                  cr);
 
   return r;
 }