lilypond-devel
[Top][All Lists]
Advanced

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

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


From: Joe Neeman
Subject: Re: Reduces algorithm time by prefinding footnoted grobs (issue4213042)
Date: Thu, 3 Mar 2011 10:39:43 +1100

On Thu, Mar 3, 2011 at 3:08 AM, Mike Solomon <address@hidden> wrote:
On Mar 2, 2011, at 8:05 AM, Mike Solomon wrote:

> On Mar 2, 2011, at 7:23 AM, address@hidden wrote:
>
>> I haven't had time to look at this carefully, but I'll have closer look
>> later. What I don't understand, though, is why this problem needs such
>> extensive changes. If it's just a matter of preventing repeated
>> footnotes at the beginning/end of a line, it should be enough to examine
>> footnote->get_column ()->get_rank ()
>> and possibly
>> footnote->get_parent (X_AXIS)->get_property ("break-visibility")
>> when you're constructing a Line_details.
>>
>
> This may work - I honestly don't know.  I'll look into doing it this way.
>

I had a chance to mull over it a little bit.
When I compile the following minimal example from Neil:

\new Staff \with { \consists "Footnote_engraver" }
\relative c' {
 \footnoteGrob #'TimeSignature #'(0 . 2) "foo" "bar"
 c1
}

as I populate the grob vector, pacifier prints to the command line tell me that all 3 time signatures have a rank of 0 and yield true for is_visible ().
I guess that's because TimeSignature is always break-visible. In any case, you can tell which TimeSignature is which by looking at Item::break_status_dir.

As a general remark about the order of things, the line breaking and page breaking are finalized at the same time. Therefore you shouldn't rely, in page breaking, on any of the line breaking having been done.
 
 The only way I can think of weeding the fake ones out is by killing the ones with no x-extent.  Your suggestion does, however, seem to tie into cases like:

\new Staff \with { \consists "Footnote_engraver" }
\relative c' {
 c1 \time 3/4 \break \pageBreak \footnoteGrob #'TimeSignature #'(0 . 2) "foo" "bar" c2.

}

So one point to make here is that more than one TimeSignature is actually visible, and you probably only want one footnote to show up. So filtering on visibility isn't quite enough; you also need to decide which one should have a footnote if the grob falls on a line break. In any case, I think that all the information you need is available at the time Line_details is constructed: you can check the break-visibility and break_status_dir of each grob, and you can check
whether they fall on the line break by looking at their column's rank.


Cheers,
Joe


reply via email to

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