+/* chord->width is updated as a side effect */
+static void
+_draw_chord (score_t *score, cairo_t *cr,
+ score_staff_t *staff, score_chord_t *chord)
+{
+ cairo_text_extents_t chord_extents;
+ double total_staff_height;
+
+ /* XXX: The staff should manage this height itself. */
+ total_staff_height = (staff->upper_ledger_lines * score->space_height +
+ score->staff_height +
+ staff->lower_ledger_lines * score->space_height);
+
+ cairo_save (cr);
+
+ cairo_text_extents (cr, chord->name, &chord_extents);
+
+ cairo_select_font_face (cr, "serif", 0, 0);
+ cairo_set_font_size (cr, score->space_height * 3);
+
+ if (staff->clef == SCORE_CLEF_G)
+ cairo_move_to (cr, 0, - score->space_height * 0.5);
+ else
+ cairo_move_to (cr, 0, score->space_height * 0.5 + total_staff_height + chord_extents.y_bearing);
+
+ cairo_show_text (cr, chord->name);
+
+ chord->width = chord_extents.x_advance;
+
+ cairo_restore (cr);
+}
+