On 2012/08/01 06:45:22, MikeSol wrote:
Avoid measuring extents when engraving is happening because they could
be
dependent on other callbacks which could trigger many layout decisions
before
engraving is finished.
This is a case where measuring extents early seems appropriate. Phil wants the line-indents, thus line-lengths, thus some very early layout decisions, to depend on the extents of the instrument names. The dependency is reversed in this case from the more usual situations where Mike's suggestion holds, such as the extent of a hairpin, which depends on the layout.
Here, what I would do is use the Pointer_group_interface to add two
grob arrays Running through those arrays and re-checking the lengths of the instrument names every time we look up the line-indent, would let the line-breaker see if those lengths changed for some reason depending on the evolving layout. I do not expect the line-breaker to behave sensibly if the indents change like this.
Properties, in LilyPond, are the best way to stash information.
Phil, working with properties, or in this case Scheme variables associated with layout, does seems necessary. See set_variable(). Old scores where we chose \paper {indent = 2.3\cm } to fit the instrument names should continue to work. If you can figure out enough Scheme to have LilyPond initialize indent so that it evaluates a different Scheme variable (say, default-indent) and have the engraver updates that variable, then we can have automatically-adapting intends by default, and let users override by replacing the link to default-indent with their own choice. http://codereview.appspot.com/6457049/ _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel