- 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);
- x = x + direction * (factor * extents.width + extents.x_bearing);
- y = y - (extents.height / 2 + extents.y_bearing);
-
- cairo_move_to(cr, x, y);
- cairo_show_text(cr, text);
-}
-
-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);