-static inline void draw_centered_text(struct graph *g, cairo_t *cr, double x, double y,
- double fontsize, const char *text)
-{
- draw_aligned_text(g, cr, x, y, fontsize, text, CENTERED);
-}
-
-static inline void draw_right_justified_text(struct graph *g, cairo_t *cr,
- double x, double y,
- double fontsize, const char *text)
-{
- draw_aligned_text(g, cr, x, y, fontsize, text, RIGHT_JUSTIFIED);
-}
-
-static inline void draw_left_justified_text(struct graph *g, cairo_t *cr,
- double x, double y,
- double fontsize, const char *text)
-{
- draw_aligned_text(g, cr, x, y, fontsize, text, LEFT_JUSTIFIED);
-}
-
-static void draw_vertical_centered_text(struct graph *g, cairo_t *cr, double x,
- double y, double fontsize,
- const char *text)
-{
- double sx, sy;
- cairo_text_extents_t extents;
-
- cairo_select_font_face(cr, g->font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
-
- cairo_set_font_size(cr, fontsize);
- cairo_text_extents(cr, text, &extents);
- sx = x;
- sy = y;
- y = y + (extents.width / 2.0 + extents.x_bearing);
- x = x - (extents.height / 2.0 + extents.y_bearing);
-
- cairo_move_to(cr, x, y);
- cairo_save(cr);
- cairo_translate(cr, -sx, -sy);
- cairo_rotate(cr, -90.0 * M_PI / 180.0);
- cairo_translate(cr, sx, sy);
- cairo_show_text(cr, text);
- cairo_restore(cr);
-}
-
-static void graph_draw_common(struct graph *g, cairo_t *cr,
- double *x1, double *y1, double *x2, double *y2)
-{
- cairo_set_source_rgb(cr, 0, 0, 0);
- cairo_set_line_width (cr, 0.8);
-
- *x1 = 0.10 * g->xdim;
- *x2 = 0.95 * g->xdim;
- *y1 = 0.10 * g->ydim;
- *y2 = 0.90 * g->ydim;