Han-Wen Nienhuys wrote:
You should use get_property("stencil") unless you're doing something special. Still better is to use a callback in the spanner which copies the stencil from its children.
I originally tried get_property, but the result was that the spanned arpeggio copied the exact stencil from the child arpeggio, resulting in only part of the spanned arpeggio being drawn. It appears to me that get_property causes the stencil callback to be executed (using the data from the child arpeggio), while get_property_data got a reference the callback, allowing it to be run later. I looked for documentation or mailing list posts to figure out what was going on, but couldn't find anything that explained to me the difference between the two functions. Looking at the code in grob-property.cc, it appears to me that my analysis is correct, but I wouldn't be surprised if I'm oversimplifying things or just plain wrong.
The second option you gave does not appear to me to be possible without changing the way that spanned arpeggios are constructed. Unless I'm mistaken, spanned arpeggios are not aware of their children - the Span_arpeggio_engraver steals the stems and side-support-elements from the children and feeds them to the spanned arpeggio. It seems to me that the strategy I implemented (stealing the stencil property from a child and feeding it to the spanned arpeggio) fits this pattern.
I did realize that the ly_symbol2scm call was not needed. I've attached a new patch that does not include it.
Thanks. -Chris
>From 327618ff4ee5e1e275dfb461aa325510e3f21c97 Mon Sep 17 00:00:00 2001 From: Chris Snyder <csny...@adoromusicpub.com> Date: Sat, 20 Dec 2008 15:14:44 -0500 Subject: [PATCH] Altered spanned arpeggios to inherit the stencil property of an included arpeggio (it isn't very smart - it just gets the property from the first arpeggio it finds) --- lily/span-arpeggio-engraver.cc | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/lily/span-arpeggio-engraver.cc b/lily/span-arpeggio-engraver.cc index 07958a8..9b5f0d6 100644 --- a/lily/span-arpeggio-engraver.cc +++ b/lily/span-arpeggio-engraver.cc @@ -61,6 +61,7 @@ Span_arpeggio_engraver::process_acknowledged () { span_arpeggio_ = make_item ("Arpeggio", SCM_EOL); span_arpeggio_->set_property ("cross-staff", SCM_BOOL_T); + span_arpeggio_->set_property ("stencil", arpeggios_[0]->get_property_data ("stencil")); } } -- 1.5.6.3
_______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel