gh_double2scm (height),
SCM_UNDEFINED));
- /*
- all elements.
- */
-#if 0
- for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
-#else
- /*
- Output the staff-symbol (the last element in this list) first,
- this fixes easy-play.
- Maybe scm_reverse () is too inefficient, we could cache/remove
- last element from list traversal above.
- */
- for (SCM s = scm_reverse (get_grob_property ("all-elements")); gh_pair_p (s); s = gh_cdr (s))
-#endif
- {
- Grob *sc = unsmob_grob (gh_car (s));
- Molecule *m = sc->get_molecule ();
- if (!m)
- continue;
-
- Offset o (sc->relative_coordinate (this, X_AXIS),
- sc->relative_coordinate (this, Y_AXIS));
-
- SCM e = sc->get_grob_property ("extra-offset");
- if (gh_pair_p (e))
- {
- o[X_AXIS] += gh_scm2double (gh_car (e));
- o[Y_AXIS] += gh_scm2double (gh_cdr (e));
- }
-
- output_molecule (m->get_expr (), o);
- }
+ /* Output elements in three layers, 0, 1, 2.
+ The default layer is 1. */
+ for (int i = 0; i < 3; i++)
+ for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s);
+ s = gh_cdr (s))
+ {
+ Grob *sc = unsmob_grob (gh_car (s));
+ Molecule *m = sc->get_molecule ();
+ if (!m)
+ continue;
+
+ SCM s = sc->get_grob_property ("layer");
+ int layer = gh_number_p (s) ? gh_scm2int (s) : 1;
+ if (layer != i)
+ continue;
+
+ Offset o (sc->relative_coordinate (this, X_AXIS),
+ sc->relative_coordinate (this, Y_AXIS));
+
+ SCM e = sc->get_grob_property ("extra-offset");
+ if (gh_pair_p (e))
+ {
+ o[X_AXIS] += gh_scm2double (gh_car (e));
+ o[Y_AXIS] += gh_scm2double (gh_cdr (e));
+ }
+
+ output_molecule (m->get_expr (), o);
+ }
+
if (last_line)
{
output_scheme (gh_list (ly_symbol2scm ("stop-last-line"), SCM_UNDEFINED));
stroke
} bind def
-/draw_ez_ball % ch letter_col ball_col font
+/difficult_draw_ez_ball % ch letter_col ball_col font
{
% font
findfont 0.7 scalefont setfont
show
} bind def
+% simple, but does it work everywhere?
+/draw_ez_ball % ch letter_col ball_col font
+{
+ % font
+ findfont 0.85 scalefont setfont
+ /origin { 0.45 0 } def
+ 0 setgray
+ 1.1 setlinewidth
+ origin moveto
+ origin lineto stroke
+ % ball_col
+ setgray
+ 0.9 setlinewidth
+ origin moveto
+ origin lineto stroke
+ % letter_col
+ setgray
+ % 0.25 is empiric centering. Change to taste
+ origin moveto
+ -0.28 -0.30 rmoveto
+ % ch
+ show
+} bind def
+
/draw_volta % h w thick vert_start vert_end
{
/vert_end exch def
For text, this is `relative'(?) to the current alignment.
For barline, space after a thick line.")
+(grob-property-description 'layer number? "The output layer [0..2]. The default is 1.")
(grob-property-description 'left-padding number? "space left of accs.")
(grob-property-description 'length number? "Stem length for unbeamed stems, only for user override.")
(grob-property-description 'lengths list? "Stem length given multiplicity of flag.")