+#define ACRE_TICK_MAJOR_SIZE 6
+#define ACRE_TICK_MINOR_SIZE 3
+#define ACRE_X_TICK_VALUE_PAD 2
+#define ACRE_Y_TICK_VALUE_PAD 4
+
+static PangoLayout *
+_create_layout (acre_t *acre, const char *text)
+{
+ PangoLayout *layout;
+
+ layout = pango_cairo_create_layout (acre->cr);
+ pango_layout_set_font_description (layout, acre->font);
+ pango_layout_set_text (layout, text, -1);
+ pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
+
+ return layout;
+}
+
+#define PRINTF_FORMAT(fmt_index, va_index) __attribute__ ((__format__(__printf__, fmt_index, va_index)))
+
+static PangoLayout *
+_create_layout_vprintf (acre_t *acre, const char *fmt, va_list ap)
+{
+ PangoLayout *layout;
+ char *text;
+
+ vasprintf (&text, fmt, ap);
+
+ layout = _create_layout (acre, text);
+
+ free (text);
+
+ return layout;
+}
+
+static PangoLayout *
+_create_layout_printf (acre_t *acre, const char *fmt, ...)
+ PRINTF_FORMAT (2, 3);
+
+static PangoLayout *
+_create_layout_printf (acre_t *acre, const char *fmt, ...)
+{
+ va_list ap;
+ PangoLayout *layout;
+
+ va_start (ap, fmt);
+
+ layout = _create_layout_vprintf (acre, fmt, ap);
+
+ va_end (ap);
+
+ return layout;
+}
+
+static void
+_destroy_layout (PangoLayout *layout)
+{
+ g_object_unref (layout);
+}
+
+static void
+_show_layout (cairo_t *cr, PangoLayout *layout)
+{
+ pango_cairo_show_layout (cr, layout);
+
+ _destroy_layout (layout);
+}