[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reduces algorithm time by prefinding footnoted grobs (issue4213042)

From: Mike Solomon
Subject: Re: Reduces algorithm time by prefinding footnoted grobs (issue4213042)
Date: Tue, 1 Mar 2011 17:46:39 -0500

On Mar 1, 2011, at 4:36 PM, Neil Puttock wrote:

> On 28 February 2011 23:02, Mike Solomon <address@hidden> wrote:
>> I can use either (cross-staff . #t) , (Y-extent . #f) , or both depending on
>> what floats people's boats.
> (Y-extent . #f) is less hackish.


>> Sorry - I've since fixed it in line 65-66 of .  Sometimes,
>> parent-spanner is not set (this likely comes from the FoonoteSpanner getting
>> broken into pieces and, for whatever reason, not getting passed a parent
>> spanner property.  That or the parent spanner no longer exists).
> It doesn't get broken into pieces since it only spans one column.
> While there is some code in which would split such spanners
> (see the comment in do_break_processing ()), it never gets called
> since left_bound->get_system () always returns a valid system (the
> system's guaranteed to be set before do_break_processing () is
> called).
>> This is part of a larger problem, which is that in the current
>> implementation, the parent-spanner is not yet broken into pieces when passed
>> to Balloon::print_spanner.  This means that the annotation cannot apply to
>> anything but the first spanner of a series.  I am reticent to trigger line
>> breaking of the parent-spanner, and I'm not even certain that I'd know how
>> in a lilypondaic way.  If anyone has ideas on how to make this more
>> flexible, I'd be happy to hear what you have to say!
> It's not the parent spanner you have to worry about; the
> FootnoteSpanner never gets broken due to the way you set its bounds.
> If you copied the Y-parent's bounds, then it would span wide enough to
> trigger breaking in do_break_processing ().
> You can test this easily in a callback, though it does break the
> footnotes (and if they were fixed, I'm not sure how you'd decide which
> copy is the correct one):
> \relative c' {
>  \override FootnoteSpanner #'before-line-breaking =
>  #(lambda (grob)
>     (let ((parent (ly:grob-parent grob Y)))
>       (ly:spanner-set-bound! grob LEFT (ly:spanner-bound parent LEFT))
>       (ly:spanner-set-bound! grob RIGHT (ly:spanner-bound parent RIGHT))))
>  \footnoteGrob #'Hairpin #'(-1 . 0) "foo" "bar"
>  c1\< \break
>  c1
>  c1\!
> }

Today, I played around with having it span the same span as its parent spanner. 
 Predictably, the annotation prints on every line.  Ideally, I'd like there to 
be a setting that lets the user choose the broken spanner on which the 
annotation will print.  This seems tricky, however, because the page spacing 
calculations seem to be done before line breaking (this is, at least, what my 
pretty prints in the source indicate).  Thus, LilyPond would need to know if a 
footnote is being printed on a given page before it did break processing on the 
spanners.  If there is a safe way to trigger break processing (or something 
that simulates break processing) for certain grobs before calculating the page 
layout, this'd be ideal.

Thanks for all your help!!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]