On Tue, 27 Jan 2015 05:09:58 -0800, <nine.fierce.ball...@gmail.com> 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. _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel