/* Height of one space within a staff */
int space_height;
+ /* Minimal line width for staff lines */
+ int line_width;
+
/* Full width of staff */
int width;
};
{
score->space_height = (int) height / 4;
score->staff_height = score->space_height * 4;
+
+ score->line_width = score->space_height / 15;
+ if (score->line_width == 0)
+ score->line_width = 1;
+
return score->staff_height;
}
cairo_show_glyphs (cr, &glyph, 1);
cairo_rectangle (cr,
- 0.5, 0.5,
- score->width - 1.0, score->space_height * 4);
+ score->line_width / 2.0,
+ score->line_width / 2.0,
+ score->width - score->line_width,
+ score->space_height * 4);
for (i = 1; i < 4; i++) {
- cairo_move_to (cr, 0, i * score->space_height + 0.5);
+ cairo_move_to (cr, 0, i * score->space_height + score->line_width / 2.0);
cairo_rel_line_to (cr, score->width, 0);
}
- cairo_set_line_width (cr, 1.0);
+ cairo_set_line_width (cr, score->line_width);
cairo_set_source_rgb (cr, 0.0, 0.0, 0.0); /* black */
cairo_stroke (cr);
/* Vertical lines at each end */
cairo_rectangle (cr,
- 0.5, 0.5,
- score->width - 1.0,
+ score->line_width / 2.0,
+ score->line_width / 2.0,
+ score->width - score->line_width,
score->staff_height * 3);
cairo_set_source_rgb (cr, 0.0, 0.0, 0.0); /* black */
- cairo_set_line_width (cr, 1.0);
+ cairo_set_line_width (cr, score->line_width);
cairo_stroke (cr);
/* Top staff */