lilypond-devel
[Top][All Lists]
Advanced

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

Re: Issue 4274: Fix a cyclic dependency in Rest_collision (issue 1935900


From: Keith OHara
Subject: Re: Issue 4274: Fix a cyclic dependency in Rest_collision (issue 193590043 by address@hidden)
Date: Tue, 27 Jan 2015 19:50:44 -0800
User-agent: Opera Mail/12.16 (Win32)

On Tue, 27 Jan 2015 05:09:58 -0800, <address@hidden> wrote:

On 2015/01/27 05:21:47, Keith wrote:

I discovered this when I tried to use get_property("stencil") from
Rest::height while trying to fix issue 4245.


It looks like some rests (whole and half rests) have two glyphs, with and 
without the ledger line, so the *final* stencil should not be generated until 
after rest_collision is finished, and maybe after beams are set and rests moved 
to avoid them, when we finally know if the rest needs a ledger.

So when you ask for the stencil in order to figure note-spacing, the routine to 
generate the stencil asks for most all layout to be completed, so it knows in 
the general case whether it should fetch the glyph with a ledger.

There is some code trying to handle that problem in
  Rest::generic_extent_callback (Grob *me, Axis a)
(but it seems strange that if we want the a=Y_AXIS extent, it includes a 
possible ledger -- we would seem to need to know the height of a rest in order 
to know how far we need to move it to clear a note.)
I do not like that it re-fetches the glyph from font forge every time 
generic_extent_callback() is called; hopefully the extent is cached somewhere.

It seems that we want to look up a tentative rest glyph (either with or without 
ledger) to get the extent, figure out note spacing and line-breaking, and 
rest-collisions, and beaming, all with that extent, and then finalize the 
stencil at some point after we are finished moving rests vertically, but before 
printing.

If you can follow the sequence of calls between Scheme and C, maybe you can find a simple 
way to get this tentative extent for issue 4245.  Use of the "pure-height" in 
rest-collision.cc would assume, for purposes of placing a given rest, that every other 
rest is on staff-center.




reply via email to

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